🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

tsx

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsx - npm Package Compare versions

Comparing version
4.22.3
to
4.22.4
+1
dist/package-Bj47PlGH.mjs
var r="4.22.4";export{r as v};
"use strict";var r="4.22.4";exports.version=r;
"use strict";var ge=Object.defineProperty;var l=(e,r)=>ge(e,"name",{value:r,configurable:!0});var T=require("node:module"),he=require("node:worker_threads"),y=require("./node-features-CQLdkVE6.cjs"),n=require("./register-BOkp8V6j.cjs"),g=require("node:url"),ye=require("node:fs"),Pe=require("node:fs/promises"),h=require("./index-D9F1FXzN.cjs"),D=require("./client-D3mGB526.cjs"),S=require("node:path"),L=typeof document<"u"?document.currentScript:null;const F={active:!0,parsedTsconfig:void 0},V=l(e=>{const r={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(r.parsedTsconfig=n.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),Re=l(async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(F,V(e)),e.port&&e.port.on("message",r=>{r==="deactivate"&&(F.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Ue=l(()=>(F.parsedTsconfig=n.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),Se=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageType(e)},"getFormatFromFileUrl"),Ee=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),U="tsx-namespace=",W="tsx-commonjs-export-preparse",K=`${W}=1`,j="tsx-commonjs-virtual-query",I=new Map,B=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),J=l((e,r)=>{const t=B(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),ve=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Te=l(e=>{const r=ve(e);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const t=r.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(s=>{const o=s.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),Le=l((e,r,t)=>{const s=I.get(e);if(!s)return!1;try{const[o]=h.parseEsm(s);return o.some(a=>{if(a.d!==-1||a.n!==r)return!1;const m=Te(s.slice(a.ss,a.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),E=l(e=>{const r=e.indexOf(U);if(r===-1)return;const t=e[r-1];if(t!=="?"&&t!=="&")return;const s=r+U.length,o=e.indexOf("&",s);return o===-1?e.slice(s):e.slice(s,o)},"getNamespace"),Y=y.isFeatureSupported(y.importAttributes)?"importAttributes":"importAssertions",Z=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),k=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),we=y.isFeatureSupported(y.esmLoadReadFile),Fe=[`${j}=`],M=[`${W}=`,`${j}=`],v=l((e,r)=>r.parsedTsconfig&&n.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),je=l(e=>{if(!e.searchParams.has(j))return;const{pathname:r}=e,t=r.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const s=new URL(e);return s.pathname=r.slice(0,t),s.search="",g.fileURLToPath(s)},"getFilePathFromVirtualQuery"),Q=l(e=>{const r=e.startsWith(n.fileUrlPrefix)?new URL(e):void 0,t=r?g.fileURLToPath(r):e,s=r&&je(r),o=s||t,a=r&&s?g.pathToFileURL(o).toString()+J(r.search,Fe):e;return{fileUrl:r,filePath:o,loadUrl:a}},"getFileLoadContext"),ee=l((e,r)=>{if(!r?.search)return e;const t=J(r.search,M);return t?g.pathToFileURL(e).toString()+t:e},"getTransformPath"),te=l((e,r,t)=>{const s=[...r?B(r.search,[U,...M]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),Ie=new TextDecoder,re=l(e=>typeof e=="string"?e:Ie.decode(e),"decodeSource"),_e=l((e,r)=>{const t=new URL(r),s=r.startsWith(n.fileUrlPrefix)?Q(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(W),t.searchParams.delete(j),s&&(t.pathname=new URL(g.pathToFileURL(s)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),se=l((e,r)=>{if(!e.active)return!1;const t=E(r);if(e.namespace&&e.namespace!==t)return!1;const s=_e(e,r);return D.parent.send&&D.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),oe=l((e,r)=>{if(!n.isJsonPattern.test(e))return r;const t=r[Y];return t?.type?r:{...r,[Y]:{...t,type:"json"}}},"prepareJsonAttributes"),H=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Ce=l(e=>{const r=l(async(t,s,o)=>{if(!se(e,t))return o(t,s);const a=E(t),{fileUrl:m,filePath:c,loadUrl:i}=Q(t),u=oe(i,s),d=await o(i,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:i,loaded:d});const P=m?.searchParams.has(W)===!0,R=d.format,w=m?new URL(g.pathToFileURL(c)):void 0;if(w&&m&&(w.search=J(m.search,M)),Z(R)&&m&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await Pe.readFile(g.pathToFileURL(c),"utf8"),b=h.isESM(f);if(R==="commonjs-typescript"||!c.endsWith(".js")||b){if(!we){if(P&&b&&n.implicitTsExtensionsPattern.test(c)){const $=await h.transform(f,c,{define:{"import.meta.url":JSON.stringify(w.toString())},tsconfigRaw:v(c,e)});return I.set(t,$.code),{format:"module",source:n.inlineSourceMap($)}}return d}if(!a&&!P&&!c.endsWith(".cts"))return d;const z=!!(a||P||J(m.search,M)),X=h.transformSync(f,ee(c,m),{cjsBanner:z?`require = require("node:module").createRequire(${JSON.stringify(g.pathToFileURL(c).toString())});`:void 0,tsconfigRaw:v(c,e)});if(d.format="commonjs",d.source=n.inlineSourceMap(X),z){const $=te(c,m,a);d.responseURL=`data:text/javascript,${encodeURIComponent(X.code)}?filePath=${encodeURIComponent($)}`}return n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const p=re(d.source),C=R==="json"&&!H(s);if(R==="commonjs-typescript"){const f=h.transformSync(p,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",source:n.inlineSourceMap(f)}}if(C||k(R)||n.tsExtensionsPattern.test(t)){const f=await h.transform(p,c,{tsconfigRaw:v(c,e)});return I.set(t,f.code),{format:"module",source:n.inlineSourceMap(f)}}if(d.format==="module"){const f=h.transformDynamicImport(c,p);f?(d.source=n.inlineSourceMap(f),I.set(t,f.code)):I.set(t,p)}return d},"load2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"load",{url:t,context:s});const a=await r(t,s,o);return n.logEsm(1,"loaded",{url:t,result:a}),a}:r},"createLoad"),be=l(e=>{const r=l((t,s,o)=>{if(H(s)&&n.isGlobalCjsLoaderActive()||!se(e,t))return o(t,s);const a=E(t),{fileUrl:m,filePath:c,loadUrl:i}=Q(t),u=oe(i,s),d=o(i,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:i,loaded:d});const P=d.format;if(Z(P)&&y.isFeatureSupported(y.esmLoadReadFile)&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=ye.readFileSync(g.pathToFileURL(c),"utf8");if(P==="commonjs-typescript"||!c.endsWith(".js")||h.isESM(p)){const C=h.transformSync(p,ee(c,m),{tsconfigRaw:v(c,e)}),f=!a&&n.isGlobalCjsLoaderActive(),b=te(c,m,a);return d.format="commonjs",d.shouldBeReloadedByCJSLoader=f,d.source=n.inlineSourceMap(C),f||(d.responseURL=`data:text/javascript,${encodeURIComponent(C.code)}?filePath=${encodeURIComponent(b)}`),n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const R=re(d.source),w=P==="json"&&!H(s);if(P==="commonjs-typescript"){const p=h.transformSync(R,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:n.inlineSourceMap(p)}}if(w||k(P)||n.tsExtensionsPattern.test(t)){const p=h.transformEsmSync(R,c,{tsconfigRaw:v(c,e)});return{format:"module",source:n.inlineSourceMap(p)}}if(d.format==="module"){const p=h.transformDynamicImport(c,R);p&&(d.source=n.inlineSourceMap(p))}return d},"load2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"loadSync",{url:t,context:s});const a=r(t,s,o);return n.logEsm(1,"loadedSync",{url:t,result:a}),a}:r},"createLoadSync"),$e=Ce(F),We=y.isFeatureSupported(y.esmLoadReadFile),Je=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,ne=l(e=>!n.isFilePath(e)&&!Je.test(e),"isTsconfigPathAliasSpecifier"),O=l(e=>{if(e.url)return e.url;const r=e.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,s]=t;if(!S.isAbsolute(s))return;const o=g.pathToFileURL(s);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const a=h.readJsonFile(o);if(a?.main)return new URL(a.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),q=l(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),ae=l(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),N=l(async(e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let a;for(const m of o)try{return await t(m,r)}catch(c){const{code:i}=c;if(!q(i)&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(s)throw a},"resolveExtensions"),_=l((e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let a;for(const m of o)try{return t(m,r)}catch(c){const{code:i}=c;if(!q(i)&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(s)throw a},"resolveExtensionsSync"),Me=l(async(e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const a=await N(e,r,t);if(n.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:a}),a)return a}try{return await t(e,r)}catch(a){if(n.logEsm(3,"resolveBase error",{specifier:e,context:r,error:a}),a instanceof Error){const m=a;if(q(m.code)){const c=O(m);if(c){const i=await N(c,r,t);if(i)return i}}}throw a}},"resolveBase"),x=l((e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const a=_(e,r,t);if(n.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:a}),a)return a}try{return t(e,r)}catch(a){if(n.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:a}),a instanceof Error){const m=a;if(q(m.code)){const c=O(m);if(c){const i=_(c,r,t);if(i)return i}}}throw a}},"resolveBaseSync"),ie=l(async(e,r,t,s)=>{if(n.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=S.join(o.pathname,"index"),await N(o.toString(),r,t,!0)}try{return await Me(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=O(a);if(m)try{return await N(`${m}/index`,r,t,!0)}catch(c){const i=c,{message:u}=i;throw i.message=i.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),i.stack=i.stack.replace(u,i.message),i}}}throw o}},"resolveDirectory"),ce=l((e,r,t,s)=>{if(n.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=ae(r);if(o&&!n.isFilePath(e))return x(e,r,t,s);const a=new URL(e,r.parentURL);return a.pathname=S.join(a.pathname,"index"),o?_(g.fileURLToPath(a),r,t,!1)??x(e,r,t,s):_(a.toString(),r,t,!0)}try{return x(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=O(a);if(m)try{return _(`${m}/index`,r,t,!0)}catch(c){const i=c,{message:u}=i;throw i.message=i.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),i.stack=i.stack.replace(u,i.message),i}}}throw o}},"resolveDirectorySync"),Oe=l(async(e,r,t,s)=>{const o=ne(e);if(n.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const a=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPaths",{possiblePaths:a});for(const m of a)try{return await ie(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ie(e,r,t,s)},"resolveTsPaths"),qe=l((e,r,t,s)=>{const o=ne(e);if(n.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const a=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPathsSync",{possiblePaths:a});for(const m of a)try{return ce(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ce(e,r,t,s)},"resolveTsPathsSync"),A="tsx://",G=l((e,r)=>`${e}${e.includes("?")?"&":"?"}${r}`,"addQuery"),le=l((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(n.fileUrlPrefix)||!n.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),o=[B(s.search,[U]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(s.pathname+=`%3F${o}`,s.searchParams.set(j,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),Ne=l(e=>{const r=l(async(t,s,o)=>{if(!e.active||t.startsWith("node:"))return o(t,s);let a=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let d;if(t.startsWith(A)){try{d=JSON.parse(t.slice(A.length))}catch{}d?.namespace&&(a=d.namespace)}if(e.namespace!==a)return o(t,s);d&&(t=d.specifier,s.parentURL=d.parentURL)}const[m,c]=t.split("?"),i=await Oe(m,s,o,e);if(n.logEsm(2,"nextResolve",{resolved:i}),i.format==="builtin")return i;(!i.format||i.format==="commonjs-typescript"||i.format==="module-typescript")&&i.url.startsWith(n.fileUrlPrefix)&&(i.format=await Se(i.url),n.logEsm(2,"getFormatFromFileUrl",{resolved:i,format:i.format})),c&&(i.url+=`?${c}`);const u=s.parentURL&&i.format==="commonjs"&&n.implicitTsExtensionsPattern.test(i.url)&&(s.parentURL.includes(K)||Le(s.parentURL,t,We));return a&&!i.url.includes(U)&&(i.url=G(i.url,`${U}${a}`)),u&&(i.url=G(i.url,K)),(a||u)&&(i.url=le(i.url,i.format,a)),i},"resolve2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"resolve",{specifier:t,context:s});const a=await r(t,s,o);return n.logEsm(1,"resolved",{specifier:t,context:s,result:a}),a}:r},"createResolve"),Ae=l(e=>{const r=l((t,s,o)=>{if(!e.active||t.startsWith("node:")||ae(s)&&n.isGlobalCjsLoaderActive())return o(t,s);let a=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let u;if(t.startsWith(A)){try{u=JSON.parse(t.slice(A.length))}catch{}u?.namespace&&(a=u.namespace)}if(e.namespace!==a)return o(t,s);u&&(t=u.specifier,s.parentURL=u.parentURL)}const[m,c]=t.split("?"),i=qe(m,s,o,e);return n.logEsm(2,"nextResolve",{resolved:i}),i.format==="builtin"||((!i.format||i.format==="commonjs-typescript"||i.format==="module-typescript")&&i.url.startsWith(n.fileUrlPrefix)&&(i.format=Ee(i.url),n.logEsm(2,"getFormatFromFileUrlSync",{resolved:i,format:i.format})),c&&(i.url+=`?${c}`),a&&!i.url.includes(U)&&(i.url=G(i.url,`${U}${a}`)),i.url=le(i.url,i.format,a)),i},"resolve2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"resolveSync",{specifier:t,context:s});const a=r(t,s,o);return n.logEsm(1,"resolvedSync",{specifier:t,context:s,result:a}),a}:r},"createResolveSync"),Be=Ne(F),me=l(e=>(r,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=t.startsWith(n.fileUrlPrefix)?t:g.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let de=!1;const Qe=l(e=>{const r=[];for(let t=0;t<e.length;t+=1){const s=e[t];if(s==="--import"){const o=e[t+1];o&&r.push(o),t+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),He=l(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),ue=[new URL("loader.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CKju0f8h.cjs",document.baseURI).href).toString(),new URL("esm/index.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CKju0f8h.cjs",document.baseURI).href).toString()],xe=new Set(["tsx","tsx/esm",...ue,...ue.map(e=>decodeURI(new URL(e).pathname))]),Ge=l(e=>xe.has(e),"isTsxImport"),fe=l(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),ze=l(()=>{const e=Qe(process.execArgv),r=e.findIndex(Ge);return r>0&&e.slice(0,r).some(fe)},"hasCliTypeScriptPreload"),Xe=He().some(fe)||ze(),pe=typeof T.registerHooks=="function"&&y.isFeatureSupported(y.moduleRegisterHooksCjsReload)&&!Xe,De=l(e=>{if(!T.register&&!pe)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!de){const{_resolveFilename:c}=T;T._resolveFilename=(i,...u)=>c(n.interopCjsExports(i),...u),de=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),pe){const c=V({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),i=T.registerHooks({load:be(c),resolve:Ae(c)}),u=l(async()=>{c.active=!1,i.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=me(e.namespace),u.unregister=u),u}const{port1:t,port2:s}=new he.MessageChannel;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CKju0f8h.cjs",document.baseURI).href,data:{port:s,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[s]});const o=e?.onImport,a=o&&(c=>{c.type==="load"&&o(c.url)});a&&(t.on("message",a),t.unref());const m=l(()=>(r===!1&&process.setSourceMapsEnabled(!1),a&&t.off("message",a),t.postMessage("deactivate"),new Promise(c=>{const i=l(u=>{u.type==="deactivated"&&(c(),t.off("message",i))},"onDeactivated");t.on("message",i)})),"unregister");return e?.namespace&&(m.import=me(e.namespace),m.unregister=m),m},"register");exports.globalPreload=Ue,exports.initialize=Re,exports.load=$e,exports.register=De,exports.resolve=Be;
var $e=Object.defineProperty;var i=(e,s)=>$e(e,"name",{value:s,configurable:!0});import T from"node:module";import{MessageChannel as We}from"node:worker_threads";import{i as j,b as Je,e as z,m as be}from"./node-features-B9BBLzwu.mjs";import{l as re,t as oe,g as Oe,a as Ne,d as b,b as d,e as V,f as S,h as L,j as K,k as Ae,m as g,n as Me,w as ne,o as ae,p as O,q as ce,s as N,u as Be}from"./register-BnTWPeIB.mjs";import{pathToFileURL as h,fileURLToPath as Y}from"node:url";import{readFileSync as qe}from"node:fs";import{readFile as Qe}from"node:fs/promises";import{p as He,i as ie,t as me,a as A,b as le,c as Ge,r as Xe}from"./index-XurvG3JN.mjs";import{p as de}from"./client-D_mPDF5S.mjs";import U from"node:path";const I={active:!0,parsedTsconfig:void 0},ue=i(e=>{const s={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(s.parsedTsconfig=re(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),s},"createData"),ze=i(async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(I,ue(e)),e.port&&e.port.on("message",s=>{s==="deactivate"&&(I.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Ve=i(()=>(I.parsedTsconfig=re(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),Ke=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||oe.includes(t))return Oe(e)},"getFormatFromFileUrl"),Ye=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||oe.includes(t))return Ne(e)},"getFormatFromFileUrlSync"),R="tsx-namespace=",M="tsx-commonjs-export-preparse",fe=`${M}=1`,F="tsx-commonjs-virtual-query",C=new Map,Z=i((e,s)=>e.slice(1).split("&").filter(t=>t&&s.every(r=>!t.startsWith(r))).join("&"),"getQueryWithoutParameters"),B=i((e,s)=>{const t=Z(e,s);return t?`?${t}`:""},"getSearchWithoutParameters"),Ze=i(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),De=i(e=>{const s=Ze(e);if(/^\s*export\s*\*/.test(s))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(s))return"namespace";const t=s.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(r=>{const o=r.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),ke=i((e,s,t)=>{const r=C.get(e);if(!r)return!1;try{const[o]=He(r);return o.some(n=>{if(n.d!==-1||n.n!==s)return!1;const m=De(r.slice(n.ss,n.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),v=i(e=>{const s=e.indexOf(R);if(s===-1)return;const t=e[s-1];if(t!=="?"&&t!=="&")return;const r=s+R.length,o=e.indexOf("&",r);return o===-1?e.slice(r):e.slice(r,o)},"getNamespace"),pe=j(Je)?"importAttributes":"importAssertions",he=i(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),ge=i(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),xe=j(z),et=[`${F}=`],q=[`${M}=`,`${F}=`],w=i((e,s)=>s.parsedTsconfig&&Ae(s.parsedTsconfig,e)?s.parsedTsconfig.config:void 0,"getTsconfigRaw"),tt=i(e=>{if(!e.searchParams.has(F))return;const{pathname:s}=e,t=s.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const r=new URL(e);return r.pathname=s.slice(0,t),r.search="",Y(r)},"getFilePathFromVirtualQuery"),D=i(e=>{const s=e.startsWith(g)?new URL(e):void 0,t=s?Y(s):e,r=s&&tt(s),o=r||t,n=s&&r?h(o).toString()+B(s.search,et):e;return{fileUrl:s,filePath:o,loadUrl:n}},"getFileLoadContext"),ye=i((e,s)=>{if(!s?.search)return e;const t=B(s.search,q);return t?h(e).toString()+t:e},"getTransformPath"),Pe=i((e,s,t)=>{const r=[...s?Z(s.search,[R,...q]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return r?`${e}?${r}`:e},"getFilePathWithQuery"),st=new TextDecoder,Se=i(e=>typeof e=="string"?e:st.decode(e),"decodeSource"),rt=i((e,s)=>{const t=new URL(s),r=s.startsWith(g)?D(s).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(M),t.searchParams.delete(F),r&&(t.pathname=new URL(h(r)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),Re=i((e,s)=>{if(!e.active)return!1;const t=v(s);if(e.namespace&&e.namespace!==t)return!1;const r=rt(e,s);return de.send&&de.send({type:"dependency",path:r}),!0},"prepareLoad"),Ue=i((e,s)=>{if(!Me.test(e))return s;const t=s[pe];return t?.type?s:{...s,[pe]:{...t,type:"json"}}},"prepareJsonAttributes"),k=i(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),ot=i(e=>{const s=i(async(t,r,o)=>{if(!Re(e,t))return o(t,r);const n=v(t),{fileUrl:m,filePath:c,loadUrl:a}=D(t),u=Ue(a,r),l=await o(a,u);d(3,"loaded by next loader",{url:t,loadUrl:a,loaded:l});const y=m?.searchParams.has(M)===!0,P=l.format,E=m?new URL(h(c)):void 0;if(E&&m&&(E.search=B(m.search,q)),he(P)&&m&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await Qe(h(c),"utf8"),W=ie(f);if(P==="commonjs-typescript"||!c.endsWith(".js")||W){if(!xe){if(y&&W&&V.test(c)){const J=await me(f,c,{define:{"import.meta.url":JSON.stringify(E.toString())},tsconfigRaw:w(c,e)});return C.set(t,J.code),{format:"module",source:S(J)}}return l}if(!n&&!y&&!c.endsWith(".cts"))return l;const te=!!(n||y||B(m.search,q)),se=A(f,ye(c,m),{cjsBanner:te?`require = require("node:module").createRequire(${JSON.stringify(h(c).toString())});`:void 0,tsconfigRaw:w(c,e)});if(l.format="commonjs",l.source=S(se),te){const J=Pe(c,m,n);l.responseURL=`data:text/javascript,${encodeURIComponent(se.code)}?filePath=${encodeURIComponent(J)}`}return d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const p=Se(l.source),$=P==="json"&&!k(r);if(P==="commonjs-typescript"){const f=A(p,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",source:S(f)}}if($||ge(P)||L.test(t)){const f=await me(p,c,{tsconfigRaw:w(c,e)});return C.set(t,f.code),{format:"module",source:S(f)}}if(l.format==="module"){const f=le(c,p);f?(l.source=S(f),C.set(t,f.code)):C.set(t,p)}return l},"load2");return b?async(t,r,o)=>{d(2,"load",{url:t,context:r});const n=await s(t,r,o);return d(1,"loaded",{url:t,result:n}),n}:s},"createLoad"),nt=i(e=>{const s=i((t,r,o)=>{if(k(r)&&K()||!Re(e,t))return o(t,r);const n=v(t),{fileUrl:m,filePath:c,loadUrl:a}=D(t),u=Ue(a,r),l=o(a,u);d(3,"loaded by next loader",{url:t,loadUrl:a,loaded:l});const y=l.format;if(he(y)&&j(z)&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=qe(h(c),"utf8");if(y==="commonjs-typescript"||!c.endsWith(".js")||ie(p)){const $=A(p,ye(c,m),{tsconfigRaw:w(c,e)}),f=!n&&K(),W=Pe(c,m,n);return l.format="commonjs",l.shouldBeReloadedByCJSLoader=f,l.source=S($),f||(l.responseURL=`data:text/javascript,${encodeURIComponent($.code)}?filePath=${encodeURIComponent(W)}`),d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const P=Se(l.source),E=y==="json"&&!k(r);if(y==="commonjs-typescript"){const p=A(P,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:S(p)}}if(E||ge(y)||L.test(t)){const p=Ge(P,c,{tsconfigRaw:w(c,e)});return{format:"module",source:S(p)}}if(l.format==="module"){const p=le(c,P);p&&(l.source=S(p))}return l},"load2");return b?(t,r,o)=>{d(2,"loadSync",{url:t,context:r});const n=s(t,r,o);return d(1,"loadedSync",{url:t,result:n}),n}:s},"createLoadSync"),at=ot(I),ct=j(z),it=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,ve=i(e=>!ae(e)&&!it.test(e),"isTsconfigPathAliasSpecifier"),Q=i(e=>{if(e.url)return e.url;const s=e.message.match(/^Cannot find module '([^']+)'/);if(s){const[,r]=s;return r}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,r]=t;if(!U.isAbsolute(r))return;const o=h(r);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const n=Xe(o);if(n?.main)return new URL(n.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),H=i(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),we=i(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),G=i(async(e,s,t,r)=>{const o=ce(e);if(d(3,"resolveExtensions",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let n;for(const m of o)try{return await t(m,s)}catch(c){const{code:a}=c;if(!H(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;n=c}if(r)throw n},"resolveExtensions"),_=i((e,s,t,r)=>{const o=ce(e);if(d(3,"resolveExtensionsSync",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let n;for(const m of o)try{return t(m,s)}catch(c){const{code:a}=c;if(!H(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;n=c}if(r)throw n},"resolveExtensionsSync"),mt=i(async(e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBase",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:N(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||N(e))&&(L.test(s.parentURL)||o)){const n=await G(e,s,t);if(d(3,"resolveBase resolved",{specifier:e,context:s,resolved:n}),n)return n}try{return await t(e,s)}catch(n){if(d(3,"resolveBase error",{specifier:e,context:s,error:n}),n instanceof Error){const m=n;if(H(m.code)){const c=Q(m);if(c){const a=await G(c,s,t);if(a)return a}}}throw n}},"resolveBase"),x=i((e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBaseSync",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:N(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||N(e))&&(L.test(s.parentURL)||o)){const n=_(e,s,t);if(d(3,"resolveBaseSync resolved",{specifier:e,context:s,resolved:n}),n)return n}try{return t(e,s)}catch(n){if(d(3,"resolveBaseSync error",{specifier:e,context:s,error:n}),n instanceof Error){const m=n;if(H(m.code)){const c=Q(m);if(c){const a=_(c,s,t);if(a)return a}}}throw n}},"resolveBaseSync"),Te=i(async(e,s,t,r)=>{if(d(3,"resolveDirectory",{specifier:e,context:s,isDirectory:O.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),O.test(e)){const o=new URL(e,s.parentURL);return o.pathname=U.join(o.pathname,"index"),await G(o.toString(),s,t,!0)}try{return await mt(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectory error",{specifier:e,context:s,error:o});const n=o;if(n.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=Q(n);if(m)try{return await G(`${m}/index`,s,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectory"),Le=i((e,s,t,r)=>{if(d(3,"resolveDirectorySync",{specifier:e,context:s,isDirectory:O.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),O.test(e)){const o=we(s);if(o&&!ae(e))return x(e,s,t,r);const n=new URL(e,s.parentURL);return n.pathname=U.join(n.pathname,"index"),o?_(Y(n),s,t,!1)??x(e,s,t,r):_(n.toString(),s,t,!0)}try{return x(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectorySync error",{specifier:e,context:s,error:o});const n=o;if(n.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=Q(n);if(m)try{return _(`${m}/index`,s,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectorySync"),lt=i(async(e,s,t,r)=>{const o=ve(e);if(d(3,"resolveTsPaths",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const n=ne(r.parsedTsconfig,e);d(3,"resolveTsPaths",{possiblePaths:n});for(const m of n)try{return await Te(h(m).toString(),s,t,r)}catch{}}return Te(e,s,t,r)},"resolveTsPaths"),dt=i((e,s,t,r)=>{const o=ve(e);if(d(3,"resolveTsPathsSync",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const n=ne(r.parsedTsconfig,e);d(3,"resolveTsPathsSync",{possiblePaths:n});for(const m of n)try{return Le(h(m).toString(),s,t,r)}catch{}}return Le(e,s,t,r)},"resolveTsPathsSync"),X="tsx://",ee=i((e,s)=>`${e}${e.includes("?")?"&":"?"}${s}`,"addQuery"),Ee=i((e,s,t)=>{if(s!=="commonjs"||!e.startsWith(g)||!V.test(e))return e;const r=new URL(e),o=[Z(r.search,[R]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(r.pathname+=`%3F${o}`,r.searchParams.set(F,"1"),r.toString()):e},"preserveCommonJsQueryIdentity"),ut=i(e=>{const s=i(async(t,r,o)=>{if(!e.active||t.startsWith("node:"))return o(t,r);let n=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let l;if(t.startsWith(X)){try{l=JSON.parse(t.slice(X.length))}catch{}l?.namespace&&(n=l.namespace)}if(e.namespace!==n)return o(t,r);l&&(t=l.specifier,r.parentURL=l.parentURL)}const[m,c]=t.split("?"),a=await lt(m,r,o,e);if(d(2,"nextResolve",{resolved:a}),a.format==="builtin")return a;(!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(g)&&(a.format=await Ke(a.url),d(2,"getFormatFromFileUrl",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`);const u=r.parentURL&&a.format==="commonjs"&&V.test(a.url)&&(r.parentURL.includes(fe)||ke(r.parentURL,t,ct));return n&&!a.url.includes(R)&&(a.url=ee(a.url,`${R}${n}`)),u&&(a.url=ee(a.url,fe)),(n||u)&&(a.url=Ee(a.url,a.format,n)),a},"resolve2");return b?async(t,r,o)=>{d(2,"resolve",{specifier:t,context:r});const n=await s(t,r,o);return d(1,"resolved",{specifier:t,context:r,result:n}),n}:s},"createResolve"),ft=i(e=>{const s=i((t,r,o)=>{if(!e.active||t.startsWith("node:")||we(r)&&K())return o(t,r);let n=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let u;if(t.startsWith(X)){try{u=JSON.parse(t.slice(X.length))}catch{}u?.namespace&&(n=u.namespace)}if(e.namespace!==n)return o(t,r);u&&(t=u.specifier,r.parentURL=u.parentURL)}const[m,c]=t.split("?"),a=dt(m,r,o,e);return d(2,"nextResolve",{resolved:a}),a.format==="builtin"||((!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(g)&&(a.format=Ye(a.url),d(2,"getFormatFromFileUrlSync",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`),n&&!a.url.includes(R)&&(a.url=ee(a.url,`${R}${n}`)),a.url=Ee(a.url,a.format,n)),a},"resolve2");return b?(t,r,o)=>{d(2,"resolveSync",{specifier:t,context:r});const n=s(t,r,o);return d(1,"resolvedSync",{specifier:t,context:r,result:n}),n}:s},"createResolveSync"),pt=ut(I),je=i(e=>(s,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const r=t.startsWith(g)?t:h(t).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:r,namespace:e})}`)},"createScopedImport");let Ie=!1;const ht=i(e=>{const s=[];for(let t=0;t<e.length;t+=1){const r=e[t];if(r==="--import"){const o=e[t+1];o&&s.push(o),t+=1}else r.startsWith("--import=")&&s.push(r.slice(9))}return s},"collectImportSpecifiers"),gt=i(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),Fe=[new URL("loader.mjs",import.meta.url).toString(),new URL("esm/index.mjs",import.meta.url).toString()],yt=new Set(["tsx","tsx/esm",...Fe,...Fe.map(e=>decodeURI(new URL(e).pathname))]),Pt=i(e=>yt.has(e),"isTsxImport"),Ce=i(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),St=i(()=>{const e=ht(process.execArgv),s=e.findIndex(Pt);return s>0&&e.slice(0,s).some(Ce)},"hasCliTypeScriptPreload"),Rt=gt().some(Ce)||St(),_e=typeof T.registerHooks=="function"&&j(be)&&!Rt,Ut=i(e=>{if(!T.register&&!_e)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!Ie){const{_resolveFilename:c}=T;T._resolveFilename=(a,...u)=>c(Be(a),...u),Ie=!0}const{sourceMapsEnabled:s}=process;if(process.setSourceMapsEnabled(!0),_e){const c=ue({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),a=T.registerHooks({load:nt(c),resolve:ft(c)}),u=i(async()=>{c.active=!1,a.deregister(),s===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=je(e.namespace),u.unregister=u),u}const{port1:t,port2:r}=new We;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:r,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[r]});const o=e?.onImport,n=o&&(c=>{c.type==="load"&&o(c.url)});n&&(t.on("message",n),t.unref());const m=i(()=>(s===!1&&process.setSourceMapsEnabled(!1),n&&t.off("message",n),t.postMessage("deactivate"),new Promise(c=>{const a=i(u=>{u.type==="deactivated"&&(c(),t.off("message",a))},"onDeactivated");t.on("message",a)})),"unregister");return e?.namespace&&(m.import=je(e.namespace),m.unregister=m),m},"register");export{Ut as a,Ve as g,ze as i,at as l,pt as r};
+1
-1

@@ -1,1 +0,1 @@

"use strict";var m=Object.defineProperty;var s=(r,e)=>m(r,"name",{value:e,configurable:!0});var a=require("../../register-CHVGxKtC.cjs");require("../../get-pipe-path-D4YM6rQt.cjs");var t=require("../../register-BOkp8V6j.cjs");require("../../require-CjvaJWEr.cjs");var n=require("../../node-features-CQLdkVE6.cjs");require("node:module"),require("node:worker_threads"),require("node:url"),require("node:fs"),require("node:fs/promises"),require("../../index-D9F1FXzN.cjs"),require("node:path"),require("esbuild"),require("node:crypto"),require("node:os"),require("../../temporary-directory-B83uKxJF.cjs"),require("../../client-D3mGB526.cjs"),require("node:net"),require("module"),require("fs"),require("os"),require("path"),require("node:util"),require("../../index-BWFBUo6r.cjs");const c=s((r,e)=>{if(!e||typeof e=="object"&&!e.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const i=typeof e=="string",u=i?e:e.parentURL,q=Date.now().toString(),o=t.register({namespace:q});return!n.isFeatureSupported(n.esmLoadReadFile)&&!t.isBarePackageNamePattern.test(r)&&t.cjsExtensionPattern.test(r)?Promise.resolve(o.require(r,u)):a.register({namespace:q,...i?{}:e}).import(r,u)},"tsImport");exports.register=a.register,exports.tsImport=c;
"use strict";var m=Object.defineProperty;var s=(r,e)=>m(r,"name",{value:e,configurable:!0});var a=require("../../register-CKju0f8h.cjs");require("../../get-pipe-path-D4YM6rQt.cjs");var t=require("../../register-BOkp8V6j.cjs");require("../../require-CjvaJWEr.cjs");var n=require("../../node-features-CQLdkVE6.cjs");require("node:module"),require("node:worker_threads"),require("node:url"),require("node:fs"),require("node:fs/promises"),require("../../index-D9F1FXzN.cjs"),require("node:path"),require("esbuild"),require("node:crypto"),require("node:os"),require("../../temporary-directory-B83uKxJF.cjs"),require("../../client-D3mGB526.cjs"),require("node:net"),require("module"),require("fs"),require("os"),require("path"),require("node:util"),require("../../index-BWFBUo6r.cjs");const c=s((r,e)=>{if(!e||typeof e=="object"&&!e.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const i=typeof e=="string",u=i?e:e.parentURL,q=Date.now().toString(),o=t.register({namespace:q});return!n.isFeatureSupported(n.esmLoadReadFile)&&!t.isBarePackageNamePattern.test(r)&&t.cjsExtensionPattern.test(r)?Promise.resolve(o.require(r,u)):a.register({namespace:q,...i?{}:e}).import(r,u)},"tsImport");exports.register=a.register,exports.tsImport=c;

@@ -1,1 +0,1 @@

var s=Object.defineProperty;var i=(r,t)=>s(r,"name",{value:t,configurable:!0});import{a as p}from"../../register-D_B8UL5H.mjs";import"../../get-pipe-path-_tAJyU_v.mjs";import{r as n,i as c,c as u}from"../../register-BnTWPeIB.mjs";import"../../require-DzmC1hVr.mjs";import{i as g,e as d}from"../../node-features-B9BBLzwu.mjs";import"node:module";import"node:worker_threads";import"node:url";import"node:fs";import"node:fs/promises";import"../../index-XurvG3JN.mjs";import"node:path";import"esbuild";import"node:crypto";import"node:os";import"../../temporary-directory-BDDVQOvU.mjs";import"../../client-D_mPDF5S.mjs";import"node:net";import"module";import"fs";import"os";import"path";import"node:util";import"../../index-gbaejti9.mjs";const f=i((r,t)=>{if(!t||typeof t=="object"&&!t.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const e=typeof t=="string",o=e?t:t.parentURL,m=Date.now().toString(),a=n({namespace:m});return!g(d)&&!c.test(r)&&u.test(r)?Promise.resolve(a.require(r,o)):p({namespace:m,...e?{}:t}).import(r,o)},"tsImport");export{p as register,f as tsImport};
var s=Object.defineProperty;var i=(r,t)=>s(r,"name",{value:t,configurable:!0});import{a as p}from"../../register-CqMfTiWi.mjs";import"../../get-pipe-path-_tAJyU_v.mjs";import{r as n,i as c,c as u}from"../../register-BnTWPeIB.mjs";import"../../require-DzmC1hVr.mjs";import{i as g,e as d}from"../../node-features-B9BBLzwu.mjs";import"node:module";import"node:worker_threads";import"node:url";import"node:fs";import"node:fs/promises";import"../../index-XurvG3JN.mjs";import"node:path";import"esbuild";import"node:crypto";import"node:os";import"../../temporary-directory-BDDVQOvU.mjs";import"../../client-D_mPDF5S.mjs";import"node:net";import"module";import"fs";import"os";import"path";import"node:util";import"../../index-gbaejti9.mjs";const f=i((r,t)=>{if(!t||typeof t=="object"&&!t.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const e=typeof t=="string",o=e?t:t.parentURL,m=Date.now().toString(),a=n({namespace:m});return!g(d)&&!c.test(r)&&u.test(r)?Promise.resolve(a.require(r,o)):p({namespace:m,...e?{}:t}).import(r,o)},"tsImport");export{p as register,f as tsImport};

@@ -1,1 +0,1 @@

"use strict";var l=Object.defineProperty;var a=(e,r)=>l(e,"name",{value:r,configurable:!0});var n=require("node:worker_threads"),t=require("../node-features-CQLdkVE6.cjs"),i=require("../register-CHVGxKtC.cjs");require("../get-pipe-path-D4YM6rQt.cjs"),require("node:module"),require("node:path"),require("node:url"),require("../register-BOkp8V6j.cjs"),require("node:fs"),require("esbuild"),require("node:crypto"),require("../index-D9F1FXzN.cjs"),require("../client-D3mGB526.cjs"),require("../require-CjvaJWEr.cjs"),require("node:fs/promises"),require("module"),require("../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("fs"),require("os"),require("path"),require("node:util"),require("../index-BWFBUo6r.cjs"),require("node:net");function s(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(u){if(u!=="default"){var o=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(r,u,o.get?o:{enumerable:!0,get:a(function(){return e[u]},"get")})}}),r.default=e,Object.freeze(r)}a(s,"_interopNamespaceDefault");var q=s(n);(t.isFeatureSupported(t.moduleRegisterHooksCjsReload)&&!q.isInternalThread||t.isFeatureSupported(t.moduleRegister)&&q.isMainThread)&&i.register(),exports.globalPreload=i.globalPreload,exports.initialize=i.initialize,exports.load=i.load,exports.resolve=i.resolve;
"use strict";var l=Object.defineProperty;var a=(e,r)=>l(e,"name",{value:r,configurable:!0});var n=require("node:worker_threads"),t=require("../node-features-CQLdkVE6.cjs"),i=require("../register-CKju0f8h.cjs");require("../get-pipe-path-D4YM6rQt.cjs"),require("node:module"),require("node:path"),require("node:url"),require("../register-BOkp8V6j.cjs"),require("node:fs"),require("esbuild"),require("node:crypto"),require("../index-D9F1FXzN.cjs"),require("../client-D3mGB526.cjs"),require("../require-CjvaJWEr.cjs"),require("node:fs/promises"),require("module"),require("../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("fs"),require("os"),require("path"),require("node:util"),require("../index-BWFBUo6r.cjs"),require("node:net");function s(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(u){if(u!=="default"){var o=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(r,u,o.get?o:{enumerable:!0,get:a(function(){return e[u]},"get")})}}),r.default=e,Object.freeze(r)}a(s,"_interopNamespaceDefault");var q=s(n);(t.isFeatureSupported(t.moduleRegisterHooksCjsReload)&&!q.isInternalThread||t.isFeatureSupported(t.moduleRegister)&&q.isMainThread)&&i.register(),exports.globalPreload=i.globalPreload,exports.initialize=i.initialize,exports.load=i.load,exports.resolve=i.resolve;

@@ -1,1 +0,1 @@

import*as r from"node:worker_threads";import{i as o,m as i,a as t}from"../node-features-B9BBLzwu.mjs";import{a as m}from"../register-D_B8UL5H.mjs";import{g as P,i as S,l as c,r as q}from"../register-D_B8UL5H.mjs";import"../get-pipe-path-_tAJyU_v.mjs";import"node:module";import"node:path";import"node:url";import"../register-BnTWPeIB.mjs";import"node:fs";import"esbuild";import"node:crypto";import"../index-XurvG3JN.mjs";import"../client-D_mPDF5S.mjs";import"../require-DzmC1hVr.mjs";import"node:fs/promises";import"module";import"../temporary-directory-BDDVQOvU.mjs";import"node:os";import"fs";import"os";import"path";import"node:util";import"../index-gbaejti9.mjs";import"node:net";(o(i)&&!r.isInternalThread||o(t)&&r.isMainThread)&&m();export{P as globalPreload,S as initialize,c as load,q as resolve};
import*as r from"node:worker_threads";import{i as o,m as i,a as t}from"../node-features-B9BBLzwu.mjs";import{a as m}from"../register-CqMfTiWi.mjs";import{g as P,i as S,l as c,r as q}from"../register-CqMfTiWi.mjs";import"../get-pipe-path-_tAJyU_v.mjs";import"node:module";import"node:path";import"node:url";import"../register-BnTWPeIB.mjs";import"node:fs";import"esbuild";import"node:crypto";import"../index-XurvG3JN.mjs";import"../client-D_mPDF5S.mjs";import"../require-DzmC1hVr.mjs";import"node:fs/promises";import"module";import"../temporary-directory-BDDVQOvU.mjs";import"node:os";import"fs";import"os";import"path";import"node:util";import"../index-gbaejti9.mjs";import"node:net";(o(i)&&!r.isInternalThread||o(t)&&r.isMainThread)&&m();export{P as globalPreload,S as initialize,c as load,q as resolve};

@@ -1,1 +0,1 @@

"use strict";var r=require("./get-pipe-path-D4YM6rQt.cjs");require("./esm/index.cjs");var e=require("./register-CHVGxKtC.cjs");require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:worker_threads"),require("./node-features-CQLdkVE6.cjs"),require("node:module"),require("node:url"),require("./register-BOkp8V6j.cjs"),require("node:fs"),require("fs"),require("os"),require("path"),require("./index-D9F1FXzN.cjs"),require("esbuild"),require("node:crypto"),require("./client-D3mGB526.cjs"),require("node:net"),require("node:util"),require("./index-BWFBUo6r.cjs"),require("./require-CjvaJWEr.cjs"),require("node:fs/promises"),r.require("./cjs/index.cjs"),exports.globalPreload=e.globalPreload,exports.initialize=e.initialize,exports.load=e.load,exports.resolve=e.resolve;
"use strict";var r=require("./get-pipe-path-D4YM6rQt.cjs");require("./esm/index.cjs");var e=require("./register-CKju0f8h.cjs");require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:worker_threads"),require("./node-features-CQLdkVE6.cjs"),require("node:module"),require("node:url"),require("./register-BOkp8V6j.cjs"),require("node:fs"),require("fs"),require("os"),require("path"),require("./index-D9F1FXzN.cjs"),require("esbuild"),require("node:crypto"),require("./client-D3mGB526.cjs"),require("node:net"),require("node:util"),require("./index-BWFBUo6r.cjs"),require("./require-CjvaJWEr.cjs"),require("node:fs/promises"),r.require("./cjs/index.cjs"),exports.globalPreload=e.globalPreload,exports.initialize=e.initialize,exports.load=e.load,exports.resolve=e.resolve;

@@ -1,1 +0,1 @@

import{r}from"./get-pipe-path-_tAJyU_v.mjs";import"./esm/index.mjs";import{g as A,i as B,l as C,r as D}from"./register-D_B8UL5H.mjs";import"module";import"node:path";import"./temporary-directory-BDDVQOvU.mjs";import"node:os";import"node:worker_threads";import"./node-features-B9BBLzwu.mjs";import"node:module";import"node:url";import"./register-BnTWPeIB.mjs";import"node:fs";import"fs";import"os";import"path";import"./index-XurvG3JN.mjs";import"esbuild";import"node:crypto";import"./client-D_mPDF5S.mjs";import"node:net";import"node:util";import"./index-gbaejti9.mjs";import"./require-DzmC1hVr.mjs";import"node:fs/promises";r("./cjs/index.cjs");export{A as globalPreload,B as initialize,C as load,D as resolve};
import{r}from"./get-pipe-path-_tAJyU_v.mjs";import"./esm/index.mjs";import{g as A,i as B,l as C,r as D}from"./register-CqMfTiWi.mjs";import"module";import"node:path";import"./temporary-directory-BDDVQOvU.mjs";import"node:os";import"node:worker_threads";import"./node-features-B9BBLzwu.mjs";import"node:module";import"node:url";import"./register-BnTWPeIB.mjs";import"node:fs";import"fs";import"os";import"path";import"./index-XurvG3JN.mjs";import"esbuild";import"node:crypto";import"./client-D_mPDF5S.mjs";import"node:net";import"node:util";import"./index-gbaejti9.mjs";import"./require-DzmC1hVr.mjs";import"node:fs/promises";r("./cjs/index.cjs");export{A as globalPreload,B as initialize,C as load,D as resolve};

@@ -1,3 +0,3 @@

"use strict";var u=Object.defineProperty;var s=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=require("node:repl"),l=require("./package-CGdS2_oX.cjs"),q=require("./index-D9F1FXzN.cjs");require("node:path"),require("node:url"),require("esbuild"),require("node:crypto"),require("./node-features-CQLdkVE6.cjs"),require("node:fs"),require("node:os"),require("./temporary-directory-B83uKxJF.cjs"),console.log(`Welcome to tsx v${l.version} (Node.js ${process.version}).
"use strict";var u=Object.defineProperty;var s=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=require("node:repl"),l=require("./package-DMqO70yR.cjs"),q=require("./index-D9F1FXzN.cjs");require("node:path"),require("node:url"),require("esbuild"),require("node:crypto"),require("./node-features-CQLdkVE6.cjs"),require("node:fs"),require("node:os"),require("./temporary-directory-B83uKxJF.cjs"),console.log(`Welcome to tsx v${l.version} (Node.js ${process.version}).
Type ".help" for more information.`);const i=c.start(),{eval:p}=i,v=s(async function(e,r,o,t){const a=await q.transform(e,o,{loader:"ts",tsconfigRaw:{compilerOptions:{preserveValueImports:!0}},define:{require:"global.require"}}).catch(n=>(console.log(n.message),{code:`
`}));return p.call(this,a.code,r,o,t)},"preEval");i.eval=v;

@@ -1,3 +0,3 @@

var p=Object.defineProperty;var t=(o,r)=>p(o,"name",{value:r,configurable:!0});import a from"node:repl";import{v as l}from"./package-DyJMwVU5.mjs";import{t as c}from"./index-XurvG3JN.mjs";import"node:path";import"node:url";import"esbuild";import"node:crypto";import"./node-features-B9BBLzwu.mjs";import"node:fs";import"node:os";import"./temporary-directory-BDDVQOvU.mjs";console.log(`Welcome to tsx v${l} (Node.js ${process.version}).
var p=Object.defineProperty;var t=(o,r)=>p(o,"name",{value:r,configurable:!0});import a from"node:repl";import{v as l}from"./package-Bj47PlGH.mjs";import{t as c}from"./index-XurvG3JN.mjs";import"node:path";import"node:url";import"esbuild";import"node:crypto";import"./node-features-B9BBLzwu.mjs";import"node:fs";import"node:os";import"./temporary-directory-BDDVQOvU.mjs";console.log(`Welcome to tsx v${l} (Node.js ${process.version}).
Type ".help" for more information.`);const s=a.start(),{eval:f}=s,v=t(async function(o,r,e,i){const m=await c(o,e,{loader:"ts",tsconfigRaw:{compilerOptions:{preserveValueImports:!0}},define:{require:"global.require"}}).catch(n=>(console.log(n.message),{code:`
`}));return f.call(this,m.code,r,e,i)},"preEval");s.eval=v;
{
"name": "tsx",
"version": "4.22.3",
"version": "4.22.4",
"description": "TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files",

@@ -5,0 +5,0 @@ "keywords": [

"use strict";var r="4.22.3";exports.version=r;
var r="4.22.3";export{r as v};
"use strict";var fe=Object.defineProperty;var l=(e,r)=>fe(e,"name",{value:r,configurable:!0});var T=require("node:module"),pe=require("node:worker_threads"),y=require("./node-features-CQLdkVE6.cjs"),n=require("./register-BOkp8V6j.cjs"),g=require("node:url"),ge=require("node:fs"),he=require("node:fs/promises"),h=require("./index-D9F1FXzN.cjs"),z=require("./client-D3mGB526.cjs"),S=require("node:path"),L=typeof document<"u"?document.currentScript:null;const F={active:!0,parsedTsconfig:void 0},X=l(e=>{const r={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(r.parsedTsconfig=n.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),ye=l(async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(F,X(e)),e.port&&e.port.on("message",r=>{r==="deactivate"&&(F.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Pe=l(()=>(F.parsedTsconfig=n.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),Re=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageType(e)},"getFormatFromFileUrl"),Ue=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),U="tsx-namespace=",$="tsx-commonjs-export-preparse",V=`${$}=1`,j="tsx-commonjs-virtual-query",I=new Map,B=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),W=l((e,r)=>{const t=B(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),Se=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Ee=l(e=>{const r=Se(e);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const t=r.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(s=>{const o=s.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),ve=l((e,r,t)=>{const s=I.get(e);if(!s)return!1;try{const[o]=h.parseEsm(s);return o.some(i=>{if(i.d!==-1||i.n!==r)return!1;const m=Ee(s.slice(i.ss,i.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),E=l(e=>{const r=e.indexOf(U);if(r===-1)return;const t=e[r-1];if(t!=="?"&&t!=="&")return;const s=r+U.length,o=e.indexOf("&",s);return o===-1?e.slice(s):e.slice(s,o)},"getNamespace"),K=y.isFeatureSupported(y.importAttributes)?"importAttributes":"importAssertions",Y=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),Z=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Te=y.isFeatureSupported(y.esmLoadReadFile),Le=[`${j}=`],J=[`${$}=`,`${j}=`],v=l((e,r)=>r.parsedTsconfig&&n.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),we=l(e=>{if(!e.searchParams.has(j))return;const{pathname:r}=e,t=r.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const s=new URL(e);return s.pathname=r.slice(0,t),s.search="",g.fileURLToPath(s)},"getFilePathFromVirtualQuery"),x=l(e=>{const r=e.startsWith(n.fileUrlPrefix)?new URL(e):void 0,t=r?g.fileURLToPath(r):e,s=r&&we(r),o=s||t,i=r&&s?g.pathToFileURL(o).toString()+W(r.search,Le):e;return{fileUrl:r,filePath:o,loadUrl:i}},"getFileLoadContext"),k=l((e,r)=>{if(!r?.search)return e;const t=W(r.search,J);return t?g.pathToFileURL(e).toString()+t:e},"getTransformPath"),ee=l((e,r,t)=>{const s=[...r?B(r.search,[U,...J]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),Fe=new TextDecoder,te=l(e=>typeof e=="string"?e:Fe.decode(e),"decodeSource"),je=l((e,r)=>{const t=new URL(r),s=r.startsWith(n.fileUrlPrefix)?x(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete($),t.searchParams.delete(j),s&&(t.pathname=new URL(g.pathToFileURL(s)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),re=l((e,r)=>{if(!e.active)return!1;const t=E(r);if(e.namespace&&e.namespace!==t)return!1;const s=je(e,r);return z.parent.send&&z.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),se=l((e,r)=>{if(!n.isJsonPattern.test(e))return r;const t=r[K];return t?.type?r:{...r,[K]:{...t,type:"json"}}},"prepareJsonAttributes"),Q=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Ie=l(e=>{const r=l(async(t,s,o)=>{if(!re(e,t))return o(t,s);const i=E(t),{fileUrl:m,filePath:c,loadUrl:a}=x(t),u=se(a,s),d=await o(a,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const P=m?.searchParams.has($)===!0,R=d.format,w=m?new URL(g.pathToFileURL(c)):void 0;if(w&&m&&(w.search=W(m.search,J)),Y(R)&&m&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await he.readFile(g.pathToFileURL(c),"utf8"),b=h.isESM(f);if(R==="commonjs-typescript"||!c.endsWith(".js")||b){if(!Te){if(P&&b&&n.implicitTsExtensionsPattern.test(c)){const C=await h.transform(f,c,{define:{"import.meta.url":JSON.stringify(w.toString())},tsconfigRaw:v(c,e)});return I.set(t,C.code),{format:"module",source:n.inlineSourceMap(C)}}return d}if(!i&&!P&&!c.endsWith(".cts"))return d;const G=!!(i||P||W(m.search,J)),D=h.transformSync(f,k(c,m),{cjsBanner:G?`require = require("node:module").createRequire(${JSON.stringify(g.pathToFileURL(c).toString())});`:void 0,tsconfigRaw:v(c,e)});if(d.format="commonjs",d.source=n.inlineSourceMap(D),G){const C=ee(c,m,i);d.responseURL=`data:text/javascript,${encodeURIComponent(D.code)}?filePath=${encodeURIComponent(C)}`}return n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const p=te(d.source),_=R==="json"&&!Q(s);if(R==="commonjs-typescript"){const f=h.transformSync(p,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",source:n.inlineSourceMap(f)}}if(_||Z(R)||n.tsExtensionsPattern.test(t)){const f=await h.transform(p,c,{tsconfigRaw:v(c,e)});return I.set(t,f.code),{format:"module",source:n.inlineSourceMap(f)}}if(d.format==="module"){const f=h.transformDynamicImport(c,p);f?(d.source=n.inlineSourceMap(f),I.set(t,f.code)):I.set(t,p)}return d},"load2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"load",{url:t,context:s});const i=await r(t,s,o);return n.logEsm(1,"loaded",{url:t,result:i}),i}:r},"createLoad"),_e=l(e=>{const r=l((t,s,o)=>{if(Q(s)&&n.isGlobalCjsLoaderActive()||!re(e,t))return o(t,s);const i=E(t),{fileUrl:m,filePath:c,loadUrl:a}=x(t),u=se(a,s),d=o(a,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const P=d.format;if(Y(P)&&y.isFeatureSupported(y.esmLoadReadFile)&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=ge.readFileSync(g.pathToFileURL(c),"utf8");if(P==="commonjs-typescript"||!c.endsWith(".js")||h.isESM(p)){const _=h.transformSync(p,k(c,m),{tsconfigRaw:v(c,e)}),f=!i&&n.isGlobalCjsLoaderActive(),b=ee(c,m,i);return d.format="commonjs",d.shouldBeReloadedByCJSLoader=f,d.source=n.inlineSourceMap(_),f||(d.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent(b)}`),n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const R=te(d.source),w=P==="json"&&!Q(s);if(P==="commonjs-typescript"){const p=h.transformSync(R,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:n.inlineSourceMap(p)}}if(w||Z(P)||n.tsExtensionsPattern.test(t)){const p=h.transformEsmSync(R,c,{tsconfigRaw:v(c,e)});return{format:"module",source:n.inlineSourceMap(p)}}if(d.format==="module"){const p=h.transformDynamicImport(c,R);p&&(d.source=n.inlineSourceMap(p))}return d},"load2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"loadSync",{url:t,context:s});const i=r(t,s,o);return n.logEsm(1,"loadedSync",{url:t,result:i}),i}:r},"createLoadSync"),be=Ie(F),Ce=y.isFeatureSupported(y.esmLoadReadFile),$e=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,oe=l(e=>!n.isFilePath(e)&&!$e.test(e),"isTsconfigPathAliasSpecifier"),M=l(e=>{if(e.url)return e.url;const r=e.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,s]=t;if(!S.isAbsolute(s))return;const o=g.pathToFileURL(s);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const i=h.readJsonFile(o);if(i?.main)return new URL(i.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),O=l(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),N=l(async(e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let i;for(const m of o)try{return await t(m,r)}catch(c){const{code:a}=c;if(!O(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensions"),q=l((e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let i;for(const m of o)try{return t(m,r)}catch(c){const{code:a}=c;if(!O(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensionsSync"),We=l(async(e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const i=await N(e,r,t);if(n.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return await t(e,r)}catch(i){if(n.logEsm(3,"resolveBase error",{specifier:e,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const c=M(m);if(c){const a=await N(c,r,t);if(a)return a}}}throw i}},"resolveBase"),Je=l((e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const i=q(e,r,t);if(n.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return t(e,r)}catch(i){if(n.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const c=M(m);if(c){const a=q(c,r,t);if(a)return a}}}throw i}},"resolveBaseSync"),ne=l(async(e,r,t,s)=>{if(n.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=S.join(o.pathname,"index"),await N(o.toString(),r,t,!0)}try{return await We(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:o});const i=o;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(i);if(m)try{return await N(`${m}/index`,r,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectory"),ae=l((e,r,t,s)=>{if(n.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=S.join(o.pathname,"index"),q(o.toString(),r,t,!0)}try{return Je(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:o});const i=o;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(i);if(m)try{return q(`${m}/index`,r,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectorySync"),Me=l(async(e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPaths",{possiblePaths:i});for(const m of i)try{return await ne(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ne(e,r,t,s)},"resolveTsPaths"),Oe=l((e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPathsSync",{possiblePaths:i});for(const m of i)try{return ae(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ae(e,r,t,s)},"resolveTsPathsSync"),A="tsx://",Ne=l(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),H=l((e,r)=>`${e}${e.includes("?")?"&":"?"}${r}`,"addQuery"),ie=l((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(n.fileUrlPrefix)||!n.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),o=[B(s.search,[U]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(s.pathname+=`%3F${o}`,s.searchParams.set(j,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),qe=l(e=>{const r=l(async(t,s,o)=>{if(!e.active||t.startsWith("node:"))return o(t,s);let i=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let d;if(t.startsWith(A)){try{d=JSON.parse(t.slice(A.length))}catch{}d?.namespace&&(i=d.namespace)}if(e.namespace!==i)return o(t,s);d&&(t=d.specifier,s.parentURL=d.parentURL)}const[m,c]=t.split("?"),a=await Me(m,s,o,e);if(n.logEsm(2,"nextResolve",{resolved:a}),a.format==="builtin")return a;(!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(n.fileUrlPrefix)&&(a.format=await Re(a.url),n.logEsm(2,"getFormatFromFileUrl",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`);const u=s.parentURL&&a.format==="commonjs"&&n.implicitTsExtensionsPattern.test(a.url)&&(s.parentURL.includes(V)||ve(s.parentURL,t,Ce));return i&&!a.url.includes(U)&&(a.url=H(a.url,`${U}${i}`)),u&&(a.url=H(a.url,V)),(i||u)&&(a.url=ie(a.url,a.format,i)),a},"resolve2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"resolve",{specifier:t,context:s});const i=await r(t,s,o);return n.logEsm(1,"resolved",{specifier:t,context:s,result:i}),i}:r},"createResolve"),Ae=l(e=>{const r=l((t,s,o)=>{if(!e.active||t.startsWith("node:")||Ne(s)&&n.isGlobalCjsLoaderActive())return o(t,s);let i=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let u;if(t.startsWith(A)){try{u=JSON.parse(t.slice(A.length))}catch{}u?.namespace&&(i=u.namespace)}if(e.namespace!==i)return o(t,s);u&&(t=u.specifier,s.parentURL=u.parentURL)}const[m,c]=t.split("?"),a=Oe(m,s,o,e);return n.logEsm(2,"nextResolve",{resolved:a}),a.format==="builtin"||((!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(n.fileUrlPrefix)&&(a.format=Ue(a.url),n.logEsm(2,"getFormatFromFileUrlSync",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`),i&&!a.url.includes(U)&&(a.url=H(a.url,`${U}${i}`)),a.url=ie(a.url,a.format,i)),a},"resolve2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"resolveSync",{specifier:t,context:s});const i=r(t,s,o);return n.logEsm(1,"resolvedSync",{specifier:t,context:s,result:i}),i}:r},"createResolveSync"),Be=qe(F),ce=l(e=>(r,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=t.startsWith(n.fileUrlPrefix)?t:g.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let le=!1;const xe=l(e=>{const r=[];for(let t=0;t<e.length;t+=1){const s=e[t];if(s==="--import"){const o=e[t+1];o&&r.push(o),t+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),Qe=l(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),me=[new URL("loader.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href).toString(),new URL("esm/index.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href).toString()],He=new Set(["tsx","tsx/esm",...me,...me.map(e=>decodeURI(new URL(e).pathname))]),Ge=l(e=>He.has(e),"isTsxImport"),de=l(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),De=l(()=>{const e=xe(process.execArgv),r=e.findIndex(Ge);return r>0&&e.slice(0,r).some(de)},"hasCliTypeScriptPreload"),ze=Qe().some(de)||De(),ue=typeof T.registerHooks=="function"&&y.isFeatureSupported(y.moduleRegisterHooksCjsReload)&&!ze,Xe=l(e=>{if(!T.register&&!ue)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!le){const{_resolveFilename:c}=T;T._resolveFilename=(a,...u)=>c(n.interopCjsExports(a),...u),le=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),ue){const c=X({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),a=T.registerHooks({load:_e(c),resolve:Ae(c)}),u=l(async()=>{c.active=!1,a.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=ce(e.namespace),u.unregister=u),u}const{port1:t,port2:s}=new pe.MessageChannel;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href,data:{port:s,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[s]});const o=e?.onImport,i=o&&(c=>{c.type==="load"&&o(c.url)});i&&(t.on("message",i),t.unref());const m=l(()=>(r===!1&&process.setSourceMapsEnabled(!1),i&&t.off("message",i),t.postMessage("deactivate"),new Promise(c=>{const a=l(u=>{u.type==="deactivated"&&(c(),t.off("message",a))},"onDeactivated");t.on("message",a)})),"unregister");return e?.namespace&&(m.import=ce(e.namespace),m.unregister=m),m},"register");exports.globalPreload=Pe,exports.initialize=ye,exports.load=be,exports.register=Xe,exports.resolve=Be;
var Fe=Object.defineProperty;var i=(e,s)=>Fe(e,"name",{value:s,configurable:!0});import T from"node:module";import{MessageChannel as Ce}from"node:worker_threads";import{i as j,b as _e,e as z,m as $e}from"./node-features-B9BBLzwu.mjs";import{l as te,t as se,g as We,a as Je,d as J,b as d,e as V,f as S,h as L,j as K,k as be,m as g,n as Oe,w as re,o as Ne,p as b,q as oe,s as O,u as Ae}from"./register-BnTWPeIB.mjs";import{pathToFileURL as h,fileURLToPath as ne}from"node:url";import{readFileSync as Me}from"node:fs";import{readFile as Be}from"node:fs/promises";import{p as qe,i as ae,t as ce,a as N,b as ie,c as Qe,r as He}from"./index-XurvG3JN.mjs";import{p as me}from"./client-D_mPDF5S.mjs";import U from"node:path";const I={active:!0,parsedTsconfig:void 0},le=i(e=>{const s={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(s.parsedTsconfig=te(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),s},"createData"),Ge=i(async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(I,le(e)),e.port&&e.port.on("message",s=>{s==="deactivate"&&(I.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Xe=i(()=>(I.parsedTsconfig=te(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),ze=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return We(e)},"getFormatFromFileUrl"),Ve=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return Je(e)},"getFormatFromFileUrlSync"),R="tsx-namespace=",A="tsx-commonjs-export-preparse",de=`${A}=1`,F="tsx-commonjs-virtual-query",C=new Map,D=i((e,s)=>e.slice(1).split("&").filter(t=>t&&s.every(r=>!t.startsWith(r))).join("&"),"getQueryWithoutParameters"),M=i((e,s)=>{const t=D(e,s);return t?`?${t}`:""},"getSearchWithoutParameters"),Ke=i(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),De=i(e=>{const s=Ke(e);if(/^\s*export\s*\*/.test(s))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(s))return"namespace";const t=s.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(r=>{const o=r.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),Ye=i((e,s,t)=>{const r=C.get(e);if(!r)return!1;try{const[o]=qe(r);return o.some(a=>{if(a.d!==-1||a.n!==s)return!1;const m=De(r.slice(a.ss,a.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),v=i(e=>{const s=e.indexOf(R);if(s===-1)return;const t=e[s-1];if(t!=="?"&&t!=="&")return;const r=s+R.length,o=e.indexOf("&",r);return o===-1?e.slice(r):e.slice(r,o)},"getNamespace"),ue=j(_e)?"importAttributes":"importAssertions",fe=i(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),pe=i(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Ze=j(z),xe=[`${F}=`],B=[`${A}=`,`${F}=`],w=i((e,s)=>s.parsedTsconfig&&be(s.parsedTsconfig,e)?s.parsedTsconfig.config:void 0,"getTsconfigRaw"),ke=i(e=>{if(!e.searchParams.has(F))return;const{pathname:s}=e,t=s.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const r=new URL(e);return r.pathname=s.slice(0,t),r.search="",ne(r)},"getFilePathFromVirtualQuery"),Y=i(e=>{const s=e.startsWith(g)?new URL(e):void 0,t=s?ne(s):e,r=s&&ke(s),o=r||t,a=s&&r?h(o).toString()+M(s.search,xe):e;return{fileUrl:s,filePath:o,loadUrl:a}},"getFileLoadContext"),he=i((e,s)=>{if(!s?.search)return e;const t=M(s.search,B);return t?h(e).toString()+t:e},"getTransformPath"),ge=i((e,s,t)=>{const r=[...s?D(s.search,[R,...B]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return r?`${e}?${r}`:e},"getFilePathWithQuery"),et=new TextDecoder,ye=i(e=>typeof e=="string"?e:et.decode(e),"decodeSource"),tt=i((e,s)=>{const t=new URL(s),r=s.startsWith(g)?Y(s).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(A),t.searchParams.delete(F),r&&(t.pathname=new URL(h(r)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),Pe=i((e,s)=>{if(!e.active)return!1;const t=v(s);if(e.namespace&&e.namespace!==t)return!1;const r=tt(e,s);return me.send&&me.send({type:"dependency",path:r}),!0},"prepareLoad"),Se=i((e,s)=>{if(!Oe.test(e))return s;const t=s[ue];return t?.type?s:{...s,[ue]:{...t,type:"json"}}},"prepareJsonAttributes"),Z=i(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),st=i(e=>{const s=i(async(t,r,o)=>{if(!Pe(e,t))return o(t,r);const a=v(t),{fileUrl:m,filePath:c,loadUrl:n}=Y(t),u=Se(n,r),l=await o(n,u);d(3,"loaded by next loader",{url:t,loadUrl:n,loaded:l});const y=m?.searchParams.has(A)===!0,P=l.format,E=m?new URL(h(c)):void 0;if(E&&m&&(E.search=M(m.search,B)),fe(P)&&m&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await Be(h(c),"utf8"),$=ae(f);if(P==="commonjs-typescript"||!c.endsWith(".js")||$){if(!Ze){if(y&&$&&V.test(c)){const W=await ce(f,c,{define:{"import.meta.url":JSON.stringify(E.toString())},tsconfigRaw:w(c,e)});return C.set(t,W.code),{format:"module",source:S(W)}}return l}if(!a&&!y&&!c.endsWith(".cts"))return l;const k=!!(a||y||M(m.search,B)),ee=N(f,he(c,m),{cjsBanner:k?`require = require("node:module").createRequire(${JSON.stringify(h(c).toString())});`:void 0,tsconfigRaw:w(c,e)});if(l.format="commonjs",l.source=S(ee),k){const W=ge(c,m,a);l.responseURL=`data:text/javascript,${encodeURIComponent(ee.code)}?filePath=${encodeURIComponent(W)}`}return d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const p=ye(l.source),_=P==="json"&&!Z(r);if(P==="commonjs-typescript"){const f=N(p,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",source:S(f)}}if(_||pe(P)||L.test(t)){const f=await ce(p,c,{tsconfigRaw:w(c,e)});return C.set(t,f.code),{format:"module",source:S(f)}}if(l.format==="module"){const f=ie(c,p);f?(l.source=S(f),C.set(t,f.code)):C.set(t,p)}return l},"load2");return J?async(t,r,o)=>{d(2,"load",{url:t,context:r});const a=await s(t,r,o);return d(1,"loaded",{url:t,result:a}),a}:s},"createLoad"),rt=i(e=>{const s=i((t,r,o)=>{if(Z(r)&&K()||!Pe(e,t))return o(t,r);const a=v(t),{fileUrl:m,filePath:c,loadUrl:n}=Y(t),u=Se(n,r),l=o(n,u);d(3,"loaded by next loader",{url:t,loadUrl:n,loaded:l});const y=l.format;if(fe(y)&&j(z)&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=Me(h(c),"utf8");if(y==="commonjs-typescript"||!c.endsWith(".js")||ae(p)){const _=N(p,he(c,m),{tsconfigRaw:w(c,e)}),f=!a&&K(),$=ge(c,m,a);return l.format="commonjs",l.shouldBeReloadedByCJSLoader=f,l.source=S(_),f||(l.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent($)}`),d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const P=ye(l.source),E=y==="json"&&!Z(r);if(y==="commonjs-typescript"){const p=N(P,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:S(p)}}if(E||pe(y)||L.test(t)){const p=Qe(P,c,{tsconfigRaw:w(c,e)});return{format:"module",source:S(p)}}if(l.format==="module"){const p=ie(c,P);p&&(l.source=S(p))}return l},"load2");return J?(t,r,o)=>{d(2,"loadSync",{url:t,context:r});const a=s(t,r,o);return d(1,"loadedSync",{url:t,result:a}),a}:s},"createLoadSync"),ot=st(I),nt=j(z),at=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,Re=i(e=>!Ne(e)&&!at.test(e),"isTsconfigPathAliasSpecifier"),q=i(e=>{if(e.url)return e.url;const s=e.message.match(/^Cannot find module '([^']+)'/);if(s){const[,r]=s;return r}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,r]=t;if(!U.isAbsolute(r))return;const o=h(r);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const a=He(o);if(a?.main)return new URL(a.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),Q=i(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),H=i(async(e,s,t,r)=>{const o=oe(e);if(d(3,"resolveExtensions",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let a;for(const m of o)try{return await t(m,s)}catch(c){const{code:n}=c;if(!Q(n)&&n!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensions"),G=i((e,s,t,r)=>{const o=oe(e);if(d(3,"resolveExtensionsSync",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let a;for(const m of o)try{return t(m,s)}catch(c){const{code:n}=c;if(!Q(n)&&n!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensionsSync"),ct=i(async(e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBase",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:O(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||O(e))&&(L.test(s.parentURL)||o)){const a=await H(e,s,t);if(d(3,"resolveBase resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return await t(e,s)}catch(a){if(d(3,"resolveBase error",{specifier:e,context:s,error:a}),a instanceof Error){const m=a;if(Q(m.code)){const c=q(m);if(c){const n=await H(c,s,t);if(n)return n}}}throw a}},"resolveBase"),it=i((e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBaseSync",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:O(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||O(e))&&(L.test(s.parentURL)||o)){const a=G(e,s,t);if(d(3,"resolveBaseSync resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return t(e,s)}catch(a){if(d(3,"resolveBaseSync error",{specifier:e,context:s,error:a}),a instanceof Error){const m=a;if(Q(m.code)){const c=q(m);if(c){const n=G(c,s,t);if(n)return n}}}throw a}},"resolveBaseSync"),Ue=i(async(e,s,t,r)=>{if(d(3,"resolveDirectory",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const o=new URL(e,s.parentURL);return o.pathname=U.join(o.pathname,"index"),await H(o.toString(),s,t,!0)}try{return await ct(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectory error",{specifier:e,context:s,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=q(a);if(m)try{return await H(`${m}/index`,s,t,!0)}catch(c){const n=c,{message:u}=n;throw n.message=n.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),n.stack=n.stack.replace(u,n.message),n}}}throw o}},"resolveDirectory"),ve=i((e,s,t,r)=>{if(d(3,"resolveDirectorySync",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const o=new URL(e,s.parentURL);return o.pathname=U.join(o.pathname,"index"),G(o.toString(),s,t,!0)}try{return it(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectorySync error",{specifier:e,context:s,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=q(a);if(m)try{return G(`${m}/index`,s,t,!0)}catch(c){const n=c,{message:u}=n;throw n.message=n.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),n.stack=n.stack.replace(u,n.message),n}}}throw o}},"resolveDirectorySync"),mt=i(async(e,s,t,r)=>{const o=Re(e);if(d(3,"resolveTsPaths",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPaths",{possiblePaths:a});for(const m of a)try{return await Ue(h(m).toString(),s,t,r)}catch{}}return Ue(e,s,t,r)},"resolveTsPaths"),lt=i((e,s,t,r)=>{const o=Re(e);if(d(3,"resolveTsPathsSync",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPathsSync",{possiblePaths:a});for(const m of a)try{return ve(h(m).toString(),s,t,r)}catch{}}return ve(e,s,t,r)},"resolveTsPathsSync"),X="tsx://",dt=i(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),x=i((e,s)=>`${e}${e.includes("?")?"&":"?"}${s}`,"addQuery"),we=i((e,s,t)=>{if(s!=="commonjs"||!e.startsWith(g)||!V.test(e))return e;const r=new URL(e),o=[D(r.search,[R]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(r.pathname+=`%3F${o}`,r.searchParams.set(F,"1"),r.toString()):e},"preserveCommonJsQueryIdentity"),ut=i(e=>{const s=i(async(t,r,o)=>{if(!e.active||t.startsWith("node:"))return o(t,r);let a=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let l;if(t.startsWith(X)){try{l=JSON.parse(t.slice(X.length))}catch{}l?.namespace&&(a=l.namespace)}if(e.namespace!==a)return o(t,r);l&&(t=l.specifier,r.parentURL=l.parentURL)}const[m,c]=t.split("?"),n=await mt(m,r,o,e);if(d(2,"nextResolve",{resolved:n}),n.format==="builtin")return n;(!n.format||n.format==="commonjs-typescript"||n.format==="module-typescript")&&n.url.startsWith(g)&&(n.format=await ze(n.url),d(2,"getFormatFromFileUrl",{resolved:n,format:n.format})),c&&(n.url+=`?${c}`);const u=r.parentURL&&n.format==="commonjs"&&V.test(n.url)&&(r.parentURL.includes(de)||Ye(r.parentURL,t,nt));return a&&!n.url.includes(R)&&(n.url=x(n.url,`${R}${a}`)),u&&(n.url=x(n.url,de)),(a||u)&&(n.url=we(n.url,n.format,a)),n},"resolve2");return J?async(t,r,o)=>{d(2,"resolve",{specifier:t,context:r});const a=await s(t,r,o);return d(1,"resolved",{specifier:t,context:r,result:a}),a}:s},"createResolve"),ft=i(e=>{const s=i((t,r,o)=>{if(!e.active||t.startsWith("node:")||dt(r)&&K())return o(t,r);let a=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let u;if(t.startsWith(X)){try{u=JSON.parse(t.slice(X.length))}catch{}u?.namespace&&(a=u.namespace)}if(e.namespace!==a)return o(t,r);u&&(t=u.specifier,r.parentURL=u.parentURL)}const[m,c]=t.split("?"),n=lt(m,r,o,e);return d(2,"nextResolve",{resolved:n}),n.format==="builtin"||((!n.format||n.format==="commonjs-typescript"||n.format==="module-typescript")&&n.url.startsWith(g)&&(n.format=Ve(n.url),d(2,"getFormatFromFileUrlSync",{resolved:n,format:n.format})),c&&(n.url+=`?${c}`),a&&!n.url.includes(R)&&(n.url=x(n.url,`${R}${a}`)),n.url=we(n.url,n.format,a)),n},"resolve2");return J?(t,r,o)=>{d(2,"resolveSync",{specifier:t,context:r});const a=s(t,r,o);return d(1,"resolvedSync",{specifier:t,context:r,result:a}),a}:s},"createResolveSync"),pt=ut(I),Te=i(e=>(s,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const r=t.startsWith(g)?t:h(t).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:r,namespace:e})}`)},"createScopedImport");let Le=!1;const ht=i(e=>{const s=[];for(let t=0;t<e.length;t+=1){const r=e[t];if(r==="--import"){const o=e[t+1];o&&s.push(o),t+=1}else r.startsWith("--import=")&&s.push(r.slice(9))}return s},"collectImportSpecifiers"),gt=i(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),Ee=[new URL("loader.mjs",import.meta.url).toString(),new URL("esm/index.mjs",import.meta.url).toString()],yt=new Set(["tsx","tsx/esm",...Ee,...Ee.map(e=>decodeURI(new URL(e).pathname))]),Pt=i(e=>yt.has(e),"isTsxImport"),je=i(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),St=i(()=>{const e=ht(process.execArgv),s=e.findIndex(Pt);return s>0&&e.slice(0,s).some(je)},"hasCliTypeScriptPreload"),Rt=gt().some(je)||St(),Ie=typeof T.registerHooks=="function"&&j($e)&&!Rt,Ut=i(e=>{if(!T.register&&!Ie)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!Le){const{_resolveFilename:c}=T;T._resolveFilename=(n,...u)=>c(Ae(n),...u),Le=!0}const{sourceMapsEnabled:s}=process;if(process.setSourceMapsEnabled(!0),Ie){const c=le({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),n=T.registerHooks({load:rt(c),resolve:ft(c)}),u=i(async()=>{c.active=!1,n.deregister(),s===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=Te(e.namespace),u.unregister=u),u}const{port1:t,port2:r}=new Ce;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:r,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[r]});const o=e?.onImport,a=o&&(c=>{c.type==="load"&&o(c.url)});a&&(t.on("message",a),t.unref());const m=i(()=>(s===!1&&process.setSourceMapsEnabled(!1),a&&t.off("message",a),t.postMessage("deactivate"),new Promise(c=>{const n=i(u=>{u.type==="deactivated"&&(c(),t.off("message",n))},"onDeactivated");t.on("message",n)})),"unregister");return e?.namespace&&(m.import=Te(e.namespace),m.unregister=m),m},"register");export{Ut as a,Xe as g,Ge as i,ot as l,pt as r};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display