Added new_site as a raw tailwind+html site; initialized npm modules; demo template

This commit is contained in:
BlueFox committed 2025-02-10 07:08:13 +01:00
1 parent 20316167ce
commit 17b3c9e9e9
306 files changed
+70895

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+235
View File
@@ -0,0 +1,235 @@
# jiti
<!-- automd:badges color=F0DB4F bundlephobia -->
[![npm version](https://img.shields.io/npm/v/jiti?color=F0DB4F)](https://npmjs.com/package/jiti)
[![npm downloads](https://img.shields.io/npm/dm/jiti?color=F0DB4F)](https://npmjs.com/package/jiti)
[![bundle size](https://img.shields.io/bundlephobia/minzip/jiti?color=F0DB4F)](https://bundlephobia.com/package/jiti)
<!-- /automd -->
> This is the active development branch. Check out [jiti/v1](https://github.com/unjs/jiti/tree/v1) for legacy v1 docs and code.
## 🌟 Used in
[Docusaurus](https://docusaurus.io/), [ESLint](https://github.com/eslint/eslint), [FormKit](https://formkit.com/), [Histoire](https://histoire.dev/), [Knip](https://knip.dev/), [Nitro](https://nitro.unjs.io/), [Nuxt](https://nuxt.com/), [PostCSS loader](https://github.com/webpack-contrib/postcss-loader), [Rsbuild](https://rsbuild.dev/), [Size Limit](https://github.com/ai/size-limit), [Slidev](https://sli.dev/), [Tailwindcss](https://tailwindcss.com/), [Tokenami](https://github.com/tokenami/tokenami), [UnoCSS](https://unocss.dev/), [WXT](https://wxt.dev/), [Winglang](https://www.winglang.io/), [Graphql code generator](https://the-guild.dev/graphql/codegen), [Lingui](https://lingui.dev/), [Scaffdog](https://scaff.dog/), [Storybook](https://storybook.js.org), [...UnJS ecosystem](https://unjs.io/), [...60M+ npm monthly downloads](https://npm.chart.dev/jiti), [...6M+ public repositories](https://github.com/unjs/jiti/network/dependents).
## ✅ Features
- Seamless TypeScript and ESM syntax support for Node.js
- Seamless interoperability between ESM and CommonJS
- Asynchronous API to replace `import()`
- Synchronous API to replace `require()` (deprecated)
- Super slim and zero dependency
- Custom resolve aliases
- Smart syntax detection to avoid extra transforms
- Node.js native `require.cache` integration
- Filesystem transpile with hard disk caches
- ESM Loader support
- JSX support (opt-in)
> [!IMPORTANT]
> To enhance compatibility, jiti `>=2.1` enabled [`interopdefault`](#interopdefault) using a new Proxy method. If you migrated to `2.0.0` earlier, this might have caused behavior changes. In case of any issues during the upgrade, please [report](https://github.com/unjs/jiti/issues) so we can investigate to solve them. 🙏🏼
## 💡 Usage
### CLI
You can use `jiti` CLI to quickly run any script with TypeScript and native ESM support!
```bash
npx jiti ./index.ts
```
### Programmatic
Initialize a jiti instance:
```js
// ESM
import { createJiti } from "jiti";
const jiti = createJiti(import.meta.url);
// CommonJS (deprecated)
const { createJiti } = require("jiti");
const jiti = createJiti(__filename);
```
Import (async) and resolve with ESM compatibility:
```js
// jiti.import(id) is similar to import(id)
const mod = await jiti.import("./path/to/file.ts");
// jiti.esmResolve(id) is similar to import.meta.resolve(id)
const resolvedPath = jiti.esmResolve("./src");
```
If you need the default export of module, you can use `jiti.import(id, { default: true })` as shortcut to `mod?.default ?? mod`.
```js
// shortcut to mod?.default ?? mod
const modDefault = await jiti.import("./path/to/file.ts", { default: true });
```
CommonJS (sync & deprecated):
```js
// jiti() is similar to require(id)
const mod = jiti("./path/to/file.ts");
// jiti.resolve() is similar to require.resolve(id)
const resolvedPath = jiti.resolve("./src");
```
You can also pass options as the second argument:
```js
const jiti = createJiti(import.meta.url, { debug: true });
```
### Register global ESM loader
You can globally register jiti using [global hooks](https://nodejs.org/api/module.html#initialize). (Important: Requires Node.js > 20)
```js
import "jiti/register";
```
Or:
```bash
node --import jiti/register index.ts
```
## 🎈 `jiti/native`
You can alias `jiti` to `jiti/native` to directly depend on runtime's [`import.meta.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve) and dynamic [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) support. This allows easing up the ecosystem transition to runtime native support by giving the same API of jiti.
## ⚙️ Options
### `debug`
- Type: Boolean
- Default: `false`
- Environment variable: `JITI_DEBUG`
Enable verbose logging. You can use `JITI_DEBUG=1 <your command>` to enable it.
### `fsCache`
- Type: Boolean | String
- Default: `true`
- Environment variable: `JITI_FS_CACHE`
Filesystem source cache (enabled by default)
By default (when is `true`), jiti uses `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/jiti`.
**Note:** It is recommended that this option be enabled for better performance.
### `moduleCache`
- Type: String
- Default: `true`
- Environment variable: `JITI_MODULE_CACHE`
Runtime module cache (enabled by default).
Disabling allows editing code and importing the same module multiple times.
When enabled, jiti integrates with Node.js native CommonJS cache-store.
### `transform`
- Type: Function
- Default: Babel (lazy loaded)
Transform function. See [src/babel](./src/babel.ts) for more details
### `sourceMaps`
- Type: Boolean
- Default `false`
- Environment variable: `JITI_SOURCE_MAPS`
Add inline source map to transformed source for better debugging.
### `interopDefault`
- Type: Boolean
- Default: `true`
- Environment variable: `JITI_INTEROP_DEFAULT`
Jiti combines module exports with the `default` export using an internal Proxy to improve compatibility with mixed CJS/ESM usage. You can check the current implementation [here](https://github.com/unjs/jiti/blob/main/src/utils.ts#L105).
### `alias`
- Type: Object
- Default: -
- Environment variable: `JITI_ALIAS`
You can also pass an object to the environment variable for inline config. Example: `JITI_ALIAS='{"~/*": "./src/*"}' jiti ...`.
Custom alias map used to resolve IDs.
### `nativeModules`
- Type: Array
- Default: ['typescript']
- Environment variable: `JITI_NATIVE_MODULES`
List of modules (within `node_modules`) to always use native `require()` for them.
### `transformModules`
- Type: Array
- Default: []
- Environment variable: `JITI_TRANSFORM_MODULES`
List of modules (within `node_modules`) to transform them regardless of syntax.
### `importMeta`
Parent module's [`import.meta`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) context to use for ESM resolution. (only used for `jiti/native` import).
### `tryNative`
- Type: Boolean
- Default: Enabled if bun is detected
- Environment variable: `JITI_TRY_NATIVE`
Try to use native require and import without jiti transformations first.
### `jsx`
- Type: Boolean | {options}
- Default: `false`
- Environment Variable: `JITI_JSX`
Enable JSX support using [`@babel/plugin-transform-react-jsx`](https://babeljs.io/docs/babel-plugin-transform-react-jsx).
See [`test/fixtures/jsx`](./test/fixtures/jsx) for framework integration examples.
## Development
- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run `pnpm dev`
- Run `pnpm jiti ./test/path/to/file.ts`
## License
<!-- automd:contributors license=MIT author="pi0" -->
Published under the [MIT](https://github.com/unjs/jiti/blob/main/LICENSE) license.
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/jiti/graphs/contributors) 💛
<br><br>
<a href="https://github.com/unjs/jiti/graphs/contributors">
<img src="https://contrib.rocks/image?repo=unjs/jiti" />
</a>
<!-- /automd -->
<!-- automd:with-automd -->
+246
View File
@@ -0,0 +1,246 @@
(()=>{var __webpack_modules__={"./node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/dist/remapping.umd.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=function(traceMapping,genMapping){"use strict";const SOURCELESS_MAPPING=SegmentObject("",-1,-1,"",null,!1),EMPTY_SOURCES=[];function SegmentObject(source,line,column,name,content,ignore){return{source,line,column,name,content,ignore}}function Source(map,sources,source,content,ignore){return{map,sources,source,content,ignore}}function MapSource(map,sources){return Source(map,sources,"",null,!1)}function OriginalSource(source,content,ignore){return Source(null,EMPTY_SOURCES,source,content,ignore)}function traceMappings(tree){const gen=new genMapping.GenMapping({file:tree.map.file}),{sources:rootSources,map}=tree,rootNames=map.names,rootMappings=traceMapping.decodedMappings(map);for(let i=0;i<rootMappings.length;i++){const segments=rootMappings[i];for(let j=0;j<segments.length;j++){const segment=segments[j],genCol=segment[0];let traced=SOURCELESS_MAPPING;if(1!==segment.length&&(traced=originalPositionFor(rootSources[segment[1]],segment[2],segment[3],5===segment.length?rootNames[segment[4]]:""),null==traced))continue;const{column,line,name,content,source,ignore}=traced;genMapping.maybeAddSegment(gen,i,genCol,source,line,column,name),source&&null!=content&&genMapping.setSourceContent(gen,source,content),ignore&&genMapping.setIgnore(gen,source,!0)}}return gen}function originalPositionFor(source,line,column,name){if(!source.map)return SegmentObject(source.source,line,column,name,source.content,source.ignore);const segment=traceMapping.traceSegment(source.map,line,column);return null==segment?null:1===segment.length?SOURCELESS_MAPPING:originalPositionFor(source.sources[segment[1]],segment[2],segment[3],5===segment.length?source.map.names[segment[4]]:name)}function asArray(value){return Array.isArray(value)?value:[value]}function buildSourceMapTree(input,loader){const maps=asArray(input).map((m=>new traceMapping.TraceMap(m,""))),map=maps.pop();for(let i=0;i<maps.length;i++)if(maps[i].sources.length>1)throw new Error(`Transformation map ${i} must have exactly one source file.\nDid you specify these with the most recent transformation maps first?`);let tree=build(map,loader,"",0);for(let i=maps.length-1;i>=0;i--)tree=MapSource(maps[i],[tree]);return tree}function build(map,loader,importer,importerDepth){const{resolvedSources,sourcesContent,ignoreList}=map,depth=importerDepth+1;return MapSource(map,resolvedSources.map(((sourceFile,i)=>{const ctx={importer,depth,source:sourceFile||"",content:void 0,ignore:void 0},sourceMap=loader(ctx.source,ctx),{source,content,ignore}=ctx;return sourceMap?build(new traceMapping.TraceMap(sourceMap,source),loader,source,depth):OriginalSource(source,void 0!==content?content:sourcesContent?sourcesContent[i]:null,void 0!==ignore?ignore:!!ignoreList&&ignoreList.includes(i))})))}class SourceMap{constructor(map,options){const out=options.decodedMappings?genMapping.toDecodedMap(map):genMapping.toEncodedMap(map);this.version=out.version,this.file=out.file,this.mappings=out.mappings,this.names=out.names,this.ignoreList=out.ignoreList,this.sourceRoot=out.sourceRoot,this.sources=out.sources,options.excludeContent||(this.sourcesContent=out.sourcesContent)}toString(){return JSON.stringify(this)}}function remapping(input,loader,options){const opts="object"==typeof options?options:{excludeContent:!!options,decodedMappings:!1},tree=buildSourceMapTree(input,loader);return new SourceMap(traceMappings(tree),opts)}return remapping}(__webpack_require__("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"))},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files lazy recursive":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files lazy recursive",module.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files sync recursive":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files sync recursive",module.exports=webpackEmptyContext},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.26.0/node_modules/@babel/plugin-synLine truncated
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(AMD_ARGUMENTS, factory);
} else if (typeof exports === "object") {
factory(COMMON_ARGUMENTS);
} else {
factory(BROWSER_ARGUMENTS);
}
})(UMD_ROOT, function (FACTORY_PARAMETERS) {
FACTORY_BODY
});
`(replacements);function buildGlobal(allowlist){const namespace=identifier("babelHelpers"),body=[],container=functionExpression(null,[identifier("global")],blockStatement(body)),tree=program([expressionStatement(callExpression(container,[conditionalExpression(binaryExpression("===",unaryExpression("typeof",identifier("global")),stringLiteral("undefined")),identifier("self"),identifier("global"))]))]);return body.push(variableDeclaration("var",[variableDeclarator(namespace,assignmentExpression("=",memberExpression(identifier("global"),namespace),objectExpression([])))])),buildHelpers(body,namespace,allowlist),tree}function buildModule(allowlist){const body=[],refs=buildHelpers(body,null,allowlist);return body.unshift(exportNamedDeclaration(null,Object.keys(refs).map((name=>exportSpecifier(cloneNode(refs[name]),identifier(name)))))),program(body,[],"module")}function buildUmd(allowlist){const namespace=identifier("babelHelpers"),body=[];return body.push(variableDeclaration("var",[variableDeclarator(namespace,identifier("global"))])),buildHelpers(body,namespace,allowlist),program([buildUmdWrapper({FACTORY_PARAMETERS:identifier("global"),BROWSER_ARGUMENTS:assignmentExpression("=",memberExpression(identifier("root"),namespace),objectExpression([])),COMMON_ARGUMENTS:identifier("exports"),AMD_ARGUMENTS:arrayExpression([stringLiteral("exports")]),FACTORY_BODY:body,UMD_ROOT:identifier("this")})])}function buildVar(allowlist){const namespace=identifier("babelHelpers"),body=[];body.push(variableDeclaration("var",[variableDeclarator(namespace,objectExpression([]))]));const tree=program(body);return buildHelpers(body,namespace,allowlist),body.push(expressionStatement(namespace)),tree}function buildHelpers(body,namespace,allowlist){const getHelperReference=name=>namespace?memberExpression(namespace,identifier(name)):identifier(`_${name}`),refs={};return helpers().list.forEach((function(name){if(allowlist&&!allowlist.includes(name))return;const ref=refs[name]=getHelperReference(name),{nodes}=helpers().get(name,getHelperReference,namespace?null:`_${name}`,[],namespace?(ast,exportName,mapExportBindingAssignments)=>{mapExportBindingAssignments((node=>assignmentExpression("=",ref,node))),ast.body.push(expressionStatement(assignmentExpression("=",ref,identifier(exportName))))}:null);body.push(...nodes)})),refs}},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transform-ast.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _gensync(){const data=__webpack_require__("./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js");return _gensync=function(){return data},data}Object.defineProperty(exports,"__esModule",{value:!0}),exports.transformFromAst=void 0,exports.transformFromAstAsync=function(...args){return(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args)},exports.transformFromAstSync=function(...args){return(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args)};var _index=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/index.js"),_index2=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transformation/index.js"),_rewriteStackTrace=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js");const transformFromAstRunner=_gensync()((function*(ast,code,opts){const config=yield*(0,_index.default)(opts);if(null===config)return null;if(!ast)throw new Error("No AST given");return yield*(0,_index2.run)(config,code,ast)}));exports.transformFromAst=function(ast,code,optsOrCallback,maybeCallback){let opts,callback;if("function"==typeof optsOrCallback?(callback=optsOrCallback,opts=void 0):(opts=optsOrCallback,callback=maybeCallback),void 0===callback)return(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast,code,opts);(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast,code,opts,callback)}},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transform-file.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _gensync(){const data=__webpack_require__("./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js");return _gensync=function(){return data},data}Object.defineProperty(exports,"__esModule",{value:!0}),exports.transformFile=function(...args){transformFileRunner.errback(...args)},exports.transformFileAsync=function(...args){return transformFileRunner.async(...args)},exports.transformFileSync=function(...args){return transformFileRunner.sync(...args)};var _index=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/index.js"),_index2=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transformation/index.js"),fs=__webpack_require__("./node_modules/.pnpm/@babel+core@7 Line truncated
${function(file){return file.addHelper("decorate")}(file)}(
${classDecorators||_core.types.nullLiteral()},
function (${initializeId}, ${superClass?_core.types.cloneNode(superId):null}) {
${node}
return { F: ${_core.types.cloneNode(node.id)}, d: ${definitions} };
},
${superClass}
)
`;isStrict||wrapperCall.arguments[1].body.directives.push(_core.types.directive(_core.types.directiveLiteral("use strict")));let replacement=wrapperCall,classPathDesc="arguments.1.body.body.0";isDeclaration&&(replacement=_core.template.statement.ast`let ${ref} = ${wrapperCall}`,classPathDesc="declarations.0.init."+classPathDesc);return{instanceNodes:[_core.template.statement.ast`
${_core.types.cloneNode(initializeId)}(this)
`],wrapClass:path=>(path.replaceWith(replacement),path.get(classPathDesc))}},exports.hasDecorators=function(node){return hasOwnDecorators(node)||node.body.body.some(hasOwnDecorators)},exports.hasOwnDecorators=hasOwnDecorators;var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_helperReplaceSupers=__webpack_require__("./node_modules/.pnpm/@babel+helper-replace-supers@7.25.9_@babel+core@7.26.0/node_modules/@babel/helper-replace-supers/lib/index.js");function hasOwnDecorators(node){var _node$decorators;return!(null==(_node$decorators=node.decorators)||!_node$decorators.length)}function prop(key,value){return value?_core.types.objectProperty(_core.types.identifier(key),value):null}function takeDecorators(node){let result;return node.decorators&&node.decorators.length>0&&(result=_core.types.arrayExpression(node.decorators.map((decorator=>decorator.expression)))),node.decorators=void 0,result}function getKey(node){return node.computed?node.key:_core.types.isIdentifier(node.key)?_core.types.stringLiteral(node.key.name):_core.types.stringLiteral(String(node.key.value))}},"./node_modules/.pnpm/@babel+helper-create-class-features-plugin@7.25.9_@babel+core@7.26.0/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function({assertVersion,assumption},{loose},version,inherits){var _assumption,_assumption2;assertVersion("2023-11"===version||"2023-05"===version||"2023-01"===version?"^7.21.0":"2021-12"===version?"^7.16.0":"^7.19.0");const VISITED=new WeakSet,constantSuper=null!=(_assumption=assumption("constantSuper"))?_assumption:loose,ignoreFunctionLength=null!=(_assumption2=assumption("ignoreFunctionLength"))?_assumption2:loose,namedEvaluationVisitor=function(isAnonymous,visitor){function handleComputedProperty(propertyPath,key,state){switch(key.type){case"StringLiteral":return _core.types.stringLiteral(key.value);case"NumericLiteral":case"BigIntLiteral":{const keyValue=key.value+"";return propertyPath.get("key").replaceWith(_core.types.stringLiteral(keyValue)),_core.types.stringLiteral(keyValue)}default:{const ref=propertyPath.scope.maybeGenerateMemoised(key);return propertyPath.get("key").replaceWith(_core.types.assignmentExpression("=",ref,createToPropertyKeyCall(state,key))),_core.types.cloneNode(ref)}}}return{VariableDeclarator(path,state){const id=path.node.id;if("Identifier"===id.type){const initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("init"));if(isAnonymous(initializer)){const name=id.name;visitor(initializer,state,name)}}},AssignmentExpression(path,state){const id=path.node.left;if("Identifier"===id.type){const initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("right"));if(isAnonymous(initializer))switch(path.node.operator){case"=":case"&&=":case"||=":case"??=":visitor(initializer,state,id.name)}}},AssignmentPattern(path,state){const id=path.node.left;if("Identifier"===id.type){const initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("right"));if(isAnonymous(initializer)){const name=id.name;visitor(initializer,state,name)}}},ObjectExpression(path,state){for(const propertyPath of path.get("properties")){if(!propertyPath.isObjectProperty())continue;const{node}=propertyPath,id=node.key,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(propertyPath.get("value"));if(isAnonymous(initializer))if(node.computed){const ref=handleComputedProperty(propertyPath,id,state);visitor(initializer,state,ref)}else if(!isProtoKey(id))if("Identifier"===id.type)visitor(initializer,state,id.name);else{const className=_core.types.stringLiteral(id.value+"");visitor(initializer,state,className)}}},ClassPrivateProperty(path,state){const{node}=path,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));if(isAnonymous(initializer)){const className=_core.types.stringLiteral("#"+node.key.id.name);visitor(initializer,state,className)}},ClassAccessorProperty(path,state){const{node}=path,id=node.key,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));if(isAnonymous(initializer))if(node.computed){const ref=handleComputedProperty(path,id,state);visitor(initializer,state,ref)}else if("Identifier"===id.type)visitor(initializer,state,id.name);else if("PrivateName"===id.type){const className=_core.types.stringLiteral("#"+id.id.name);visitor(initializer,state,className)}else{const className=_core.types.stringLiteral(id.value+"");visitor(initializer,state,className)}},ClassProperty(path,state){const{node}=path,id=node.key,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));if(isAnonymous(initializer))if(node.c Line truncated
class extends ${state.addHelper("identity")} {}
`;staticsClass.body.body=[_core.types.classProperty(_core.types.toExpression(originalClass),void 0,void 0,void 0,!0,!0),...statics];const constructorBody=[],newExpr=_core.types.newExpression(staticsClass,[]);staticFieldInitializerExpressions.length>0&&constructorBody.push(...staticFieldInitializerExpressions),classInitCall&&(classInitInjected=!0,constructorBody.push(classInitCall)),constructorBody.length>0?(constructorBody.unshift(_core.types.callExpression(_core.types.super(),[_core.types.cloneNode(classIdLocal)])),staticsClass.body.body.push(createConstructorFromExpressions(constructorBody,!1))):newExpr.arguments.push(_core.types.cloneNode(classIdLocal));const[newPath]=path.replaceWith(newExpr);originalClassPath=newPath.get("callee").get("body").get("body.0.key")}}!classInitInjected&&classInitCall&&path.node.body.body.push(_core.types.staticBlock([_core.types.expressionStatement(classInitCall)]));let{superClass}=originalClass;if(superClass&&("2023-11"===version||"2023-05"===version)){const id=path.scope.maybeGenerateMemoised(superClass);id&&(originalClass.superClass=_core.types.assignmentExpression("=",id,superClass),superClass=id)}const applyDecoratorWrapper=_core.types.staticBlock([]);originalClass.body.body.unshift(applyDecoratorWrapper);const applyDecsBody=applyDecoratorWrapper.body;if(computedKeyAssignments.length>0){const elements=originalClassPath.get("body.body");let firstPublicElement;for(const path of elements)if((path.isClassProperty()||path.isClassMethod())&&"constructor"!==path.node.kind){firstPublicElement=path;break}null!=firstPublicElement?(!function(path){const{node}=path;node.computed=!0,_core.types.isIdentifier(node.key)&&(node.key=_core.types.stringLiteral(node.key.name))}(firstPublicElement),prependExpressionsToComputedKey(computedKeyAssignments,firstPublicElement)):(originalClass.body.body.unshift(_core.types.classProperty(_core.types.sequenceExpression([...computedKeyAssignments,_core.types.stringLiteral("_")]),void 0,void 0,void 0,!0,!0)),applyDecsBody.push(_core.types.expressionStatement(_core.types.unaryExpression("delete",_core.types.memberExpression(_core.types.thisExpression(),_core.types.identifier("_")))))),computedKeyAssignments=[]}applyDecsBody.push(_core.types.expressionStatement(function(elementLocals,classLocals,elementDecorations,classDecorations,classDecorationsFlag,maybePrivateBrandName,setClassName,superClass,state,version){let lhs,rhs;const args=[setClassName?createSetFunctionNameCall(state,setClassName):_core.types.thisExpression(),classDecorations,elementDecorations];"2023-11"!==version&&args.splice(1,2,elementDecorations,classDecorations);if("2021-12"===version||"2022-03"===version&&!state.availableHelper("applyDecs2203R"))return lhs=_core.types.arrayPattern([...elementLocals,...classLocals]),rhs=_core.types.callExpression(state.addHelper("2021-12"===version?"applyDecs":"applyDecs2203"),args),_core.types.assignmentExpression("=",lhs,rhs);"2022-03"===version?rhs=_core.types.callExpression(state.addHelper("applyDecs2203R"),args):"2023-01"===version?(maybePrivateBrandName&&args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)),rhs=_core.types.callExpression(state.addHelper("applyDecs2301"),args)):"2023-05"===version&&((maybePrivateBrandName||superClass||0!==classDecorationsFlag.value)&&args.push(classDecorationsFlag),maybePrivateBrandName?args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)):superClass&&args.push(_core.types.unaryExpression("void",_core.types.numericLiteral(0))),superClass&&args.push(superClass),rhs=_core.types.callExpression(state.addHelper("applyDecs2305"),args));"2023-11"===version&&((maybePrivateBrandName||superClass||0!==classDecorationsFlag.value)&&args.push(classDecorationsFlag),maybePrivateBrandName?args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)):superClass&&args.push(_core.types.unaryExpression("void",_core.types.numericLiteral(0))),superClass&&args.push(superClass),rhs=_core.types.callExpression(state.addHelper("applyDecs2311"),args));elementLocals.length>0?classLocals.length>0?lhs=_core.types.objectPattern([_core.types.objectProperty(_core.types.identifier("e"),_core.types.arrayPattern(elementLocals)),_core.types.objectProperty(_core.types.identifier("c"),_core.types.arrayPattern(classLocals))]):(lhs=_core.types.arrayPattern(elementLocals),rhs=_core.types.memberExpression(rhs,_core.types.identifier("e"),!1,!1)):(lhs=_core.types.arrayPattern(classLocals),rhs=_core.types.memberExpression(rhs,_core.types.identifier("c"),!1,!1));return _core.types.assignmentExpression("=",lhs,rhs)}(elementLocals,classLocals,elementDecorations,null!=(_classDecorationsId=classDecorationsId)?_classDecorationsId:_core.types.arrayExpression(classDecorations),_core.types.numericLiteral(classDecorationsFlag),needsInstancePrivateBrandCheck?lastInstancePrivateName:null,setClassName,_core.types.cloneNode(superClass),state,version))),staticInitLocal&&applyDecsBody.push(_core.types.expressionStatement(_core.types.callExpressi Line truncated
function () {
return this.${_core.types.cloneNode(targetKey)};
}
`,_core.template.expression.ast`
function (value) {
this.${_core.types.cloneNode(targetKey)} = value;
}
`]:[_core.template.expression.ast`
o => o.${_core.types.cloneNode(targetKey)}
`,_core.template.expression.ast`
(o, v) => o.${_core.types.cloneNode(targetKey)} = v
`]}function getComputedKeyLastElement(path){if((path=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path)).isSequenceExpression()){const expressions=path.get("expressions");return getComputedKeyLastElement(expressions[expressions.length-1])}return path}function getComputedKeyMemoiser(path){const element=getComputedKeyLastElement(path);if(element.isConstantExpression())return _core.types.cloneNode(path.node);if(element.isIdentifier()&&path.scope.hasUid(element.node.name))return _core.types.cloneNode(path.node);if(element.isAssignmentExpression()&&element.get("left").isIdentifier())return _core.types.cloneNode(element.node.left);throw new Error(`Internal Error: the computed key ${path.toString()} has not yet been memoised.`)}function prependExpressionsToComputedKey(expressions,fieldPath){const key=fieldPath.get("key");key.isSequenceExpression()?expressions.push(...key.node.expressions):expressions.push(key.node),key.replaceWith(maybeSequenceExpression(expressions))}function prependExpressionsToFieldInitializer(expressions,fieldPath){const initializer=fieldPath.get("value");initializer.node?expressions.push(initializer.node):expressions.length>0&&(expressions[expressions.length-1]=_core.types.unaryExpression("void",expressions[expressions.length-1])),initializer.replaceWith(maybeSequenceExpression(expressions))}function prependExpressionsToStaticBlock(expressions,blockPath){blockPath.unshiftContainer("body",_core.types.expressionStatement(maybeSequenceExpression(expressions)))}function isProtoInitCallExpression(expression,protoInitCall){return _core.types.isCallExpression(expression)&&_core.types.isIdentifier(expression.callee,{name:protoInitCall.name})}function createConstructorFromExpressions(expressions,isDerivedClass){const body=[_core.types.expressionStatement(maybeSequenceExpression(expressions))];return isDerivedClass&&body.unshift(_core.types.expressionStatement(_core.types.callExpression(_core.types.super(),[_core.types.spreadElement(_core.types.identifier("args"))]))),_core.types.classMethod("constructor",_core.types.identifier("constructor"),isDerivedClass?[_core.types.restElement(_core.types.identifier("args"))]:[],_core.types.blockStatement(body))}function createStaticBlockFromExpressions(expressions){return _core.types.staticBlock([_core.types.expressionStatement(maybeSequenceExpression(expressions))])}const FIELD=0,ACCESSOR=1,METHOD=2,GETTER=3,SETTER=4,STATIC_OLD_VERSION=5,STATIC=8,DECORATORS_HAVE_THIS=16;function getElementKind(element){switch(element.node.type){case"ClassProperty":case"ClassPrivateProperty":return FIELD;case"ClassAccessorProperty":return ACCESSOR;case"ClassMethod":case"ClassPrivateMethod":return"get"===element.node.kind?GETTER:"set"===element.node.kind?SETTER:METHOD}}function generateDecorationList(decorators,decoratorsThis,version){const decsCount=decorators.length,haveOneThis=decoratorsThis.some(Boolean),decs=[];for(let i=0;i<decsCount;i++)"2023-11"!==version&&"2023-05"!==version||!haveOneThis||decs.push(decoratorsThis[i]||_core.types.unaryExpression("void",_core.types.numericLiteral(0))),decs.push(decorators[i].expression);return{haveThis:haveOneThis,decs}}function addCallAccessorsFor(version,element,key,getId,setId,isStatic){element.insertAfter(_core.types.classPrivateMethod("get",_core.types.cloneNode(key),[],_core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(_core.types.cloneNode(getId),"2023-11"===version&&isStatic?[]:[_core.types.thisExpression()]))]),isStatic)),element.insertAfter(_core.types.classPrivateMethod("set",_core.types.cloneNode(key),[_core.types.identifier("v")],_core.types.blockStatement([_core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(setId),"2023-11"===version&&isStatic?[_core.types.identifier("v")]:[_core.types.thisExpression(),_core.types.identifier("v")]))]),isStatic))}function movePrivateAccessor(element,key,methodLocalVar,isStatic){let params,block;"set"===element.node.kind?(params=[_core.types.identifier("v")],block=[_core.types.expressionStatement(_core.types.callExpression(methodLocalVar,[_core.types.thisExpression(),_core.types.identifier("v")]))]):(params=[],block=[_core.types.returnStatement(_core.types.callExpression(methodLocalVar,[_core.types.thisExpression()]))]),element.replaceWith(_core.types.classPrivateMethod(element.node.kind,_core.types.cloneNode(key),params,_core.types.blockStatement(block),isStatic))}function isClassDecoratableElementPath(path){const{type}=path;return"TSDeclareMethod"!==type&&"TSIndexSignature"!==type&&"StaticBlock"!==type}function maybeSequenceExpression(exprs){return 0===exprs.length?_core.types.unaryExpression("void",_core.types.numericLiteral(0)):1===exprs.length?exprs[0]:_core.types.sequenceExpression(exprs)}function createFunctionExpressionFromPrivateMethod(node){const{params,body,generator:isGenerator,async:isAsync}=node;return _core.types.functionExpression(void 0,params,body,isGenerator,isAsync)}function createS Line truncated
Object.prototype.hasOwnProperty.call(${buildCheckInRHS(right,file)}, ${_core.types.cloneNode(id)})
`)}const{id,static:isStatic}=privateNamesMap.get(name);isStatic?path.replaceWith(_core.template.expression.ast`${buildCheckInRHS(right,file)} === ${_core.types.cloneNode(this.classRef)}`):path.replaceWith(_core.template.expression.ast`${_core.types.cloneNode(id)}.has(${buildCheckInRHS(right,file)})`)}});function readOnlyError(file,name){return _core.types.callExpression(file.addHelper("readOnlyError"),[_core.types.stringLiteral(`#${name}`)])}function writeOnlyError(file,name){return file.availableHelper("writeOnlyError")?_core.types.callExpression(file.addHelper("writeOnlyError"),[_core.types.stringLiteral(`#${name}`)]):(console.warn("@babel/helpers is outdated, update it to silence this warning."),_core.types.buildUndefinedNode())}function buildStaticPrivateFieldAccess(expr,noUninitializedPrivateFieldAccess){return noUninitializedPrivateFieldAccess?expr:_core.types.memberExpression(expr,_core.types.identifier("_"))}function autoInherits(fn){return function(member){return _core.types.inherits(fn.apply(this,arguments),member.node)}}const privateNameHandlerSpec={memoise(member,count){const{scope}=member,{object}=member.node,memo=scope.maybeGenerateMemoised(object);memo&&this.memoiser.set(object,memo,count)},receiver(member){const{object}=member.node;return this.memoiser.has(object)?_core.types.cloneNode(this.memoiser.get(object)):_core.types.cloneNode(object)},get:autoInherits((function(member){const{classRef,privateNamesMap,file,innerBinding,noUninitializedPrivateFieldAccess}=this,privateName=member.node.property,{name}=privateName.id,{id,static:isStatic,method:isMethod,methodId,getId,setId}=privateNamesMap.get(name),isGetterOrSetter=getId||setId,cloneId=id=>_core.types.inherits(_core.types.cloneNode(id),privateName);if(isStatic){if(unshadow(classRef.name,member.scope,innerBinding),!newHelpers(file)){const helperName=isMethod&&!isGetterOrSetter?"classStaticPrivateMethodGet":"classStaticPrivateFieldSpecGet";return _core.types.callExpression(file.addHelper(helperName),[this.receiver(member),_core.types.cloneNode(classRef),cloneId(id)])}const receiver=this.receiver(member),skipCheck=_core.types.isIdentifier(receiver)&&receiver.name===classRef.name;if(!isMethod)return buildStaticPrivateFieldAccess(skipCheck?cloneId(id):_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(classRef),receiver,cloneId(id)]),noUninitializedPrivateFieldAccess);if(getId)return skipCheck?_core.types.callExpression(cloneId(getId),[receiver]):_core.types.callExpression(file.addHelper("classPrivateGetter"),[_core.types.cloneNode(classRef),receiver,cloneId(getId)]);if(setId){const err=_core.types.buildUndefinedNode();return skipCheck?err:_core.types.sequenceExpression([_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(classRef),receiver]),err])}return skipCheck?cloneId(id):_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(classRef),receiver,cloneId(id)])}return isMethod?isGetterOrSetter?getId?newHelpers(file)?_core.types.callExpression(file.addHelper("classPrivateGetter"),[_core.types.cloneNode(id),this.receiver(member),cloneId(getId)]):_core.types.callExpression(file.addHelper("classPrivateFieldGet"),[this.receiver(member),cloneId(id)]):_core.types.sequenceExpression([this.receiver(member),writeOnlyError(file,name)]):newHelpers(file)?_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(id),this.receiver(member),cloneId(methodId)]):_core.types.callExpression(file.addHelper("classPrivateMethodGet"),[this.receiver(member),_core.types.cloneNode(id),cloneId(methodId)]):newHelpers(file)?_core.types.callExpression(file.addHelper("classPrivateFieldGet2"),[cloneId(id),this.receiver(member)]):_core.types.callExpression(file.addHelper("classPrivateFieldGet"),[this.receiver(member),cloneId(id)])})),boundGet(member){return this.memoise(member,1),_core.types.callExpression(_core.types.memberExpression(this.get(member),_core.types.identifier("bind")),[this.receiver(member)])},set:autoInherits((function(member,value){const{classRef,privateNamesMap,file,noUninitializedPrivateFieldAccess}=this,privateName=member.node.property,{name}=privateName.id,{id,static:isStatic,method:isMethod,setId,getId}=privateNamesMap.get(name),isGetterOrSetter=getId||setId,cloneId=id=>_core.types.inherits(_core.types.cloneNode(id),privateName);if(isStatic){if(!newHelpers(file)){const helperName=isMethod&&!isGetterOrSetter?"classStaticPrivateMethodSet":"classStaticPrivateFieldSpecSet";return _core.types.callExpression(file.addHelper(helperName),[this.receiver(member),_core.types.cloneNode(classRef),cloneId(id),value])}const receiver=this.receiver(member),skipCheck=_core.types.isIdentifier(receiver)&&receiver.name===classRef.name;if(isMethod&&!setId){const err=readOnlyError(file,name);return skipCheck?_core.types.sequenceExpression([value,err]):_core.types.sequenceExpression([value,_core.types.callExpression(file.addHelper("assertClassBrand"), Line truncated
Object.defineProperty(${ref}, ${_core.types.cloneNode(id)}, {
// configurable is false by default
// enumerable is false by default
writable: true,
value: ${value}
});
`,prop)}function buildPrivateInstanceFieldInitSpec(ref,prop,privateNamesMap,state){const{id}=privateNamesMap.get(prop.node.key.id.name),value=prop.node.value||prop.scope.buildUndefinedNode();if(!state.availableHelper("classPrivateFieldInitSpec"))return inheritPropComments(_core.template.statement.ast`${_core.types.cloneNode(id)}.set(${ref}, {
// configurable is always false for private elements
// enumerable is always false for private elements
writable: true,
value: ${value},
})`,prop);const helper=state.addHelper("classPrivateFieldInitSpec");return inheritLoc(inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(helper,[_core.types.thisExpression(),inheritLoc(_core.types.cloneNode(id),prop.node.key),newHelpers(state)?value:_core.template.expression.ast`{ writable: true, value: ${value} }`])),prop),prop.node)}function buildPrivateStaticFieldInitSpec(prop,privateNamesMap,noUninitializedPrivateFieldAccess){const privateName=privateNamesMap.get(prop.node.key.id.name),value=noUninitializedPrivateFieldAccess?prop.node.value:_core.template.expression.ast`{
_: ${prop.node.value||_core.types.buildUndefinedNode()}
}`;return inheritPropComments(_core.types.variableDeclaration("var",[_core.types.variableDeclarator(_core.types.cloneNode(privateName.id),value)]),prop)}var buildPrivateStaticFieldInitSpecOld=function(prop,privateNamesMap){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,getId,setId,initAdded}=privateName,isGetterOrSetter=getId||setId;if(!prop.isProperty()&&(initAdded||!isGetterOrSetter))return;if(isGetterOrSetter)return privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),inheritPropComments(_core.template.statement.ast`
var ${_core.types.cloneNode(id)} = {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
}
`,prop);const value=prop.node.value||prop.scope.buildUndefinedNode();return inheritPropComments(_core.template.statement.ast`
var ${_core.types.cloneNode(id)} = {
// configurable is false by default
// enumerable is false by default
writable: true,
value: ${value}
};
`,prop)};function buildPrivateMethodInitLoose(ref,prop,privateNamesMap){const privateName=privateNamesMap.get(prop.node.key.id.name),{methodId,id,getId,setId,initAdded}=privateName;if(initAdded)return;if(methodId)return inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
value: ${methodId.name}
});
`,prop);return getId||setId?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
});
`,prop)):void 0}function buildPrivateInstanceMethodInitSpec(ref,prop,privateNamesMap,state){const privateName=privateNamesMap.get(prop.node.key.id.name);if(!privateName.initAdded){if(!newHelpers(state)){if(privateName.getId||privateName.setId)return function(ref,prop,privateNamesMap,state){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,getId,setId}=privateName;if(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),!state.availableHelper("classPrivateFieldInitSpec"))return inheritPropComments(_core.template.statement.ast`
${id}.set(${ref}, {
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
});
`,prop);const helper=state.addHelper("classPrivateFieldInitSpec");return inheritLoc(inheritPropComments(_core.template.statement.ast`${helper}(
${_core.types.thisExpression()},
${_core.types.cloneNode(id)},
{
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
},
)`,prop),prop.node)}(ref,prop,privateNamesMap,state)}return function(ref,prop,privateNamesMap,state){const privateName=privateNamesMap.get(prop.node.key.id.name),{id}=privateName;if(!state.availableHelper("classPrivateMethodInitSpec"))return inheritPropComments(_core.template.statement.ast`${id}.add(${ref})`,prop);const helper=state.addHelper("classPrivateMethodInitSpec");return inheritPropComments(_core.template.statement.ast`${helper}(
${_core.types.thisExpression()},
${_core.types.cloneNode(id)}
)`,prop)}(ref,prop,privateNamesMap,state)}}function buildPublicFieldInitLoose(ref,prop){const{key,computed}=prop.node,value=prop.node.value||prop.scope.buildUndefinedNode();return inheritPropComments(_core.types.expressionStatement(_core.types.assignmentExpression("=",_core.types.memberExpression(ref,key,computed||_core.types.isLiteral(key)),value)),prop)}function buildPublicFieldInitSpec(ref,prop,state){const{key,computed}=prop.node,value=prop.node.value||prop.scope.buildUndefinedNode();return inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(state.addHelper("defineProperty"),[ref,computed||_core.types.isLiteral(key)?key:_core.types.stringLiteral(key.name),value])),prop)}function buildPrivateStaticMethodInitLoose(ref,prop,state,privateNamesMap){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,methodId,getId,setId,initAdded}=privateName;if(initAdded)return;return getId||setId?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
})
`,prop)):inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
value: ${methodId.name}
});
`,prop)}function buildPrivateMethodDeclaration(file,prop,privateNamesMap,privateFieldsAsSymbolsOrProperties=!1){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,methodId,getId,setId,getterDeclared,setterDeclared,static:isStatic}=privateName,{params,body,generator,async}=prop.node,isGetter=getId&&0===params.length,isSetter=setId&&params.length>0;if(isGetter&&getterDeclared||isSetter&&setterDeclared)return privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),null;if(newHelpers(file)&&(isGetter||isSetter)&&!privateFieldsAsSymbolsOrProperties){const scope=prop.get("body").scope,thisArg=scope.generateUidIdentifier("this"),state={thisRef:thisArg,argumentsPath:[]};if(prop.traverse(thisContextVisitor,state),state.argumentsPath.length){const argumentsId=scope.generateUidIdentifier("arguments");scope.push({id:argumentsId,init:_core.template.expression.ast`[].slice.call(arguments, 1)`});for(const path of state.argumentsPath)path.replaceWith(_core.types.cloneNode(argumentsId))}params.unshift(_core.types.cloneNode(thisArg))}let declId=methodId;return isGetter?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{getterDeclared:!0,initAdded:!0})),declId=getId):isSetter?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{setterDeclared:!0,initAdded:!0})),declId=setId):isStatic&&!privateFieldsAsSymbolsOrProperties&&(declId=id),inheritPropComments(_core.types.functionDeclaration(_core.types.cloneNode(declId),params,body,generator,async),prop)}const thisContextVisitor=_traverse.visitors.environmentVisitor({Identifier(path,state){state.argumentsPath&&"arguments"===path.node.name&&state.argumentsPath.push(path)},UnaryExpression(path){const{node}=path;if("delete"===node.operator){const argument=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes)(node.argument);_core.types.isThisExpression(argument)&&path.replaceWith(_core.types.booleanLiteral(!0))}},ThisExpression(path,state){state.needsClassRef=!0,path.replaceWith(_core.types.cloneNode(state.thisRef))},MetaProperty(path){const{node,scope}=path;"new"===node.meta.name&&"target"===node.property.name&&path.replaceWith(scope.buildUndefinedNode())}}),innerReferencesVisitor={ReferencedIdentifier(path,state){path.scope.bindingIdentifierEquals(path.node.name,state.innerBinding)&&(state.needsClassRef=!0,path.node.name=state.thisRef.name)}};function replaceThisContext(path,ref,innerBindingRef){var _state$thisRef;const state={thisRef:ref,needsClassRef:!1,innerBinding:innerBindingRef};return path.isMethod()||path.traverse(thisContextVisitor,state),null!=innerBindingRef&&null!=(_state$thisRef=state.thisRef)&&_state$thisRef.name&&state.thisRef.name!==innerBindingRef.name&&path.traverse(innerReferencesVisitor,state),state.needsClassRef}function isNameOrLength({key,computed}){return"Identifier"===key.type?!computed&&("name"===key.name||"length"===key.name):"StringLiteral"===key.type&&("name"===key.value||"length"===key.value)}function inheritPropComments(node,prop){return _core.types.inheritLeadingComments(node,prop.node),_core.types.inheritInnerComments(node,prop.node),node}function inheritLoc(node,original){return node.start=original.start,node.end=original.end,node.loc=original.loc,node}},"./node_modules/.pnpm/@babel+helper-create-class-features-plugin@7.25.9_@babel+core@7.26.0/node_modules/@babel/helper-create-class-features-plugin/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"FEATURES",{enumerable:!0,get:function(){return _features.FEATURES}}),Object.defineProperty(exports,"buildCheckInRHS",{enumerable:!0,get:function(){return _fields.buildCheckInRHS}}),exports.createClassFeaturePlugin=function({name,feature,loose,manipulateOptions,api,inherits,decoratorVersion}){var _api$assumption;if(feature&_features.FEATURES.decorators&&("2023-11"===decoratorVersion||"2023-05"===decoratorVersion||"2023-01"===decoratorVersion||"2022-03"===decoratorVersion||"2021-12"===decoratorVersion))return(0,_decorators.default)(api,{loose},decoratorVersion,inherits);null!=api||(api={assumption:()=>{}});const setPublicClassFields=api.assumption("setPublicClassFields"),privateFieldsAsSymbols=api.assumption("privateFieldsAsSymbols"),privateFieldsAsProperties=api.assumption("privateFieldsAsProperties"),noUninitializedPrivateFieldAccess=null!=(_api$assumption=api.assumption("noUninitializedPrivateFieldAccess"))&&_api$assumption,constantSuper=api.assumption("constantSuper"),noDocumentAll=api.assumption("noDocumentAll");if(privateFieldsAsProperties&&privateFieldsAsSymbols)throw new Error('Cannot enable both the "privateFieldsAsProperties" and "privateFieldsAsSymbols" assumptions as the same time.');const privateFieldsAsSymbolsOrProperties=privateFieldsAsProperties||privateFieldsAsSymbols;if(!0===loose){const explicit=[];void 0!==setPublicClassFields&&explicit.push('"setPublicClassFi Line truncated
Promise.resolve().then(() => ${builder(specifier)})
`:builder(specifier);const specifierToString=_core.types.isTemplateLiteral(specifier)?_core.types.identifier("specifier"):_core.types.templateLiteral([_core.types.templateElement({raw:""}),_core.types.templateElement({raw:""})],[_core.types.identifier("specifier")]);return deferToThen?_core.template.expression.ast`
(specifier =>
new Promise(r => r(${specifierToString}))
.then(s => ${builder(_core.types.identifier("s"))})
)(${specifier})
`:wrapWithPromise?_core.template.expression.ast`
(specifier =>
new Promise(r => r(${builder(specifierToString)}))
)(${specifier})
`:_core.template.expression.ast`
(specifier => ${builder(specifierToString)})(${specifier})
`};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js");exports.getDynamicImportSource=function(node){const[source]=node.arguments;return _core.types.isStringLiteral(source)||_core.types.isTemplateLiteral(source)?source:_core.template.expression.ast`\`\${${source}}\``}},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/get-module-name.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=getModuleName;{const originalGetModuleName=getModuleName;exports.default=getModuleName=function(rootOpts,pluginOpts){var _pluginOpts$moduleId,_pluginOpts$moduleIds,_pluginOpts$getModule,_pluginOpts$moduleRoo;return originalGetModuleName(rootOpts,{moduleId:null!=(_pluginOpts$moduleId=pluginOpts.moduleId)?_pluginOpts$moduleId:rootOpts.moduleId,moduleIds:null!=(_pluginOpts$moduleIds=pluginOpts.moduleIds)?_pluginOpts$moduleIds:rootOpts.moduleIds,getModuleId:null!=(_pluginOpts$getModule=pluginOpts.getModuleId)?_pluginOpts$getModule:rootOpts.getModuleId,moduleRoot:null!=(_pluginOpts$moduleRoo=pluginOpts.moduleRoot)?_pluginOpts$moduleRoo:rootOpts.moduleRoot})}}function getModuleName(rootOpts,pluginOpts){const{filename,filenameRelative=filename,sourceRoot=pluginOpts.moduleRoot}=rootOpts,{moduleId,moduleIds=!!moduleId,getModuleId,moduleRoot=sourceRoot}=pluginOpts;if(!moduleIds)return null;if(null!=moduleId&&!getModuleId)return moduleId;let moduleName=null!=moduleRoot?moduleRoot+"/":"";if(filenameRelative){const sourceRootReplacer=null!=sourceRoot?new RegExp("^"+sourceRoot+"/?"):"";moduleName+=filenameRelative.replace(sourceRootReplacer,"").replace(/\.\w*$/,"")}return moduleName=moduleName.replace(/\\/g,"/"),getModuleId&&getModuleId(moduleName)||moduleName}},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"buildDynamicImport",{enumerable:!0,get:function(){return _dynamicImport.buildDynamicImport}}),exports.buildNamespaceInitStatements=function(metadata,sourceMetadata,constantReexports=!1,wrapReference=Lazy.wrapReference){var _wrapReference;const statements=[],srcNamespaceId=_core.types.identifier(sourceMetadata.name);for(const localName of sourceMetadata.importsNamespace)localName!==sourceMetadata.name&&statements.push(_core.template.statement`var NAME = SOURCE;`({NAME:localName,SOURCE:_core.types.cloneNode(srcNamespaceId)}));const srcNamespace=null!=(_wrapReference=wrapReference(srcNamespaceId,sourceMetadata.wrap))?_wrapReference:srcNamespaceId;constantReexports&&statements.push(...buildReexportsFromMeta(metadata,sourceMetadata,!0,wrapReference));for(const exportName of sourceMetadata.reexportNamespace)statements.push((_core.types.isIdentifier(srcNamespace)?_core.template.statement`EXPORTS.NAME = NAMESPACE;`:_core.template.statement`
Object.defineProperty(EXPORTS, "NAME", {
enumerable: true,
get: function() {
return NAMESPACE;
}
});
`)({EXPORTS:metadata.exportName,NAME:exportName,NAMESPACE:_core.types.cloneNode(srcNamespace)}));if(sourceMetadata.reexportAll){const statement=function(metadata,namespace,constantReexports){return(constantReexports?_core.template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
EXPORTS[key] = NAMESPACE[key];
});
`:_core.template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
Object.defineProperty(EXPORTS, key, {
enumerable: true,
get: function() {
return NAMESPACE[key];
},
});
});
`)({NAMESPACE:namespace,EXPORTS:metadata.exportName,VERIFY_NAME_LIST:metadata.exportNameListName?_core.template`
if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
`({EXPORTS_LIST:metadata.exportNameListName}):null})}(metadata,_core.types.cloneNode(srcNamespace),constantReexports);statement.loc=sourceMetadata.reexportAll.loc,statements.push(statement)}return statements},exports.ensureStatementsHoisted=function(statements){statements.forEach((header=>{header._blockHoist=3}))},Object.defineProperty(exports,"getModuleName",{enumerable:!0,get:function(){return _getModuleName.default}}),Object.defineProperty(exports,"hasExports",{enumerable:!0,get:function(){return _normalizeAndLoadMetadata.hasExports}}),Object.defineProperty(exports,"isModule",{enumerable:!0,get:function(){return _helperModuleImports.isModule}}),Object.defineProperty(exports,"isSideEffectImport",{enumerable:!0,get:function(){return _normalizeAndLoadMetadata.isSideEffectImport}}),exports.rewriteModuleStatementsAndPrepareHeader=function(path,{exportName,strict,allowTopLevelThis,strictMode,noInterop,importInterop=noInterop?"none":"babel",lazy,getWrapperPayload=Lazy.toGetWrapperPayload(null!=lazy&&lazy),wrapReference=Lazy.wrapReference,esNamespaceOnly,filename,constantReexports=arguments[1].loose,enumerableModuleMeta=arguments[1].loose,noIncompleteNsImportDetection}){(0,_normalizeAndLoadMetadata.validateImportInteropOption)(importInterop),_assert((0,_helperModuleImports.isModule)(path),"Cannot process module statements in a script"),path.node.sourceType="script";const meta=(0,_normalizeAndLoadMetadata.default)(path,exportName,{importInterop,initializeReexports:constantReexports,getWrapperPayload,esNamespaceOnly,filename});allowTopLevelThis||(0,_rewriteThis.default)(path);if((0,_rewriteLiveReferences.default)(path,meta,wrapReference),!1!==strictMode){path.node.directives.some((directive=>"use strict"===directive.value.value))||path.unshiftContainer("directives",_core.types.directive(_core.types.directiveLiteral("use strict")))}const headers=[];(0,_normalizeAndLoadMetadata.hasExports)(meta)&&!strict&&headers.push(function(metadata,enumerableModuleMeta=!1){return(enumerableModuleMeta?_core.template.statement`
EXPORTS.__esModule = true;
`:_core.template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
`)({EXPORTS:metadata.exportName})}(meta,enumerableModuleMeta));const nameList=function(programPath,metadata){const exportedVars=Object.create(null);for(const data of metadata.local.values())for(const name of data.names)exportedVars[name]=!0;let hasReexport=!1;for(const data of metadata.source.values()){for(const exportName of data.reexports.keys())exportedVars[exportName]=!0;for(const exportName of data.reexportNamespace)exportedVars[exportName]=!0;hasReexport=hasReexport||!!data.reexportAll}if(!hasReexport||0===Object.keys(exportedVars).length)return null;const name=programPath.scope.generateUidIdentifier("exportNames");return delete exportedVars.default,{name:name.name,statement:_core.types.variableDeclaration("var",[_core.types.variableDeclarator(name,_core.types.valueToNode(exportedVars))])}}(path,meta);nameList&&(meta.exportNameListName=nameList.name,headers.push(nameList.statement));return headers.push(...function(programPath,metadata,wrapReference,constantReexports=!1,noIncompleteNsImportDetection=!1){const initStatements=[];for(const[localName,data]of metadata.local)if("import"===data.kind);else if("hoisted"===data.kind)initStatements.push([data.names[0],buildInitStatement(metadata,data.names,_core.types.identifier(localName))]);else if(!noIncompleteNsImportDetection)for(const exportName of data.names)initStatements.push([exportName,null]);for(const data of metadata.source.values()){if(!constantReexports){const reexportsStatements=buildReexportsFromMeta(metadata,data,!1,wrapReference),reexports=[...data.reexports.keys()];for(let i=0;i<reexportsStatements.length;i++)initStatements.push([reexports[i],reexportsStatements[i]])}if(!noIncompleteNsImportDetection)for(const exportName of data.reexportNamespace)initStatements.push([exportName,null])}initStatements.sort((([a],[b])=>a<b?-1:b<a?1:0));const results=[];if(noIncompleteNsImportDetection)for(const[,initStatement]of initStatements)results.push(initStatement);else{const chunkSize=100;for(let i=0;i<initStatements.length;i+=chunkSize){let uninitializedExportNames=[];for(let j=0;j<chunkSize&&i+j<initStatements.length;j++){const[exportName,initStatement]=initStatements[i+j];null!==initStatement?(uninitializedExportNames.length>0&&(results.push(buildInitStatement(metadata,uninitializedExportNames,programPath.scope.buildUndefinedNode())),uninitializedExportNames=[]),results.push(initStatement)):uninitializedExportNames.push(exportName)}uninitializedExportNames.length>0&&results.push(buildInitStatement(metadata,uninitializedExportNames,programPath.scope.buildUndefinedNode()))}}return results}(path,meta,wrapReference,constantReexports,noIncompleteNsImportDetection)),{meta,headers}},Object.defineProperty(exports,"rewriteThis",{enumerable:!0,get:function(){return _rewriteThis.default}}),exports.wrapInterop=function(programPath,expr,type){if("none"===type)return null;if("node-namespace"===type)return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"),[expr,_core.types.booleanLiteral(!0)]);if("node-default"===type)return null;let helper;if("default"===type)helper="interopRequireDefault";else{if("namespace"!==type)throw new Error(`Unknown interop: ${type}`);helper="interopRequireWildcard"}return _core.types.callExpression(programPath.hub.addHelper(helper),[expr])};var _assert=__webpack_require__("assert"),_core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_helperModuleImports=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-imports@7.25.9/node_modules/@babel/helper-module-imports/lib/index.js"),_rewriteThis=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js"),_rewriteLiveReferences=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js"),_normalizeAndLoadMetadata=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js"),Lazy=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js"),_dynamicImport=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js"),_getModuleName=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/get-module-name.js");exports.getDynamicImportSource=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js").getDynamicImportSource;const ReexportTemplate={constant:({expor Line truncated
${exports}.${exportName} = ${namespaceImport};
`,constantComputed:({exports,exportName,namespaceImport})=>_core.template.statement.ast`
${exports}["${exportName}"] = ${namespaceImport};
`,spec:({exports,exportName,namespaceImport})=>_core.template.statement.ast`
Object.defineProperty(${exports}, "${exportName}", {
enumerable: true,
get: function() {
return ${namespaceImport};
},
});
`};function buildReexportsFromMeta(meta,metadata,constantReexports,wrapReference){var _wrapReference2;let namespace=_core.types.identifier(metadata.name);namespace=null!=(_wrapReference2=wrapReference(namespace,metadata.wrap))?_wrapReference2:namespace;const{stringSpecifiers}=meta;return Array.from(metadata.reexports,(([exportName,importName])=>{let namespaceImport=_core.types.cloneNode(namespace);"default"===importName&&"node-default"===metadata.interop||(namespaceImport=stringSpecifiers.has(importName)?_core.types.memberExpression(namespaceImport,_core.types.stringLiteral(importName),!0):_core.types.memberExpression(namespaceImport,_core.types.identifier(importName)));const astNodes={exports:meta.exportName,exportName,namespaceImport};return constantReexports||_core.types.isIdentifier(namespaceImport)?stringSpecifiers.has(exportName)?ReexportTemplate.constantComputed(astNodes):ReexportTemplate.constant(astNodes):ReexportTemplate.spec(astNodes)}))}const InitTemplate={computed:({exports,name,value})=>_core.template.expression.ast`${exports}["${name}"] = ${value}`,default:({exports,name,value})=>_core.template.expression.ast`${exports}.${name} = ${value}`,define:({exports,name,value})=>_core.template.expression.ast`
Object.defineProperty(${exports}, "${name}", {
enumerable: true,
value: void 0,
writable: true
})["${name}"] = ${value}`};function buildInitStatement(metadata,exportNames,initExpr){const{stringSpecifiers,exportName:exports}=metadata;return _core.types.expressionStatement(exportNames.reduce(((value,name)=>{const params={exports,name,value};return"__proto__"===name?InitTemplate.define(params):stringSpecifiers.has(name)?InitTemplate.computed(params):InitTemplate.default(params)}),initExpr))}},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toGetWrapperPayload=function(lazy){return(source,metadata)=>{if(!1===lazy)return null;if((0,_normalizeAndLoadMetadata.isSideEffectImport)(metadata)||metadata.reexportAll)return null;if(!0===lazy)return source.includes(".")?null:"lazy";if(Array.isArray(lazy))return lazy.includes(source)?"lazy":null;if("function"==typeof lazy)return lazy(source)?"lazy":null;throw new Error(".lazy must be a boolean, string array, or function")}},exports.wrapReference=function(ref,payload){return"lazy"===payload?_core.types.callExpression(ref,[]):null};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_normalizeAndLoadMetadata=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js")},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(programPath,exportName,{importInterop,initializeReexports=!1,getWrapperPayload,esNamespaceOnly=!1,filename}){exportName||(exportName=programPath.scope.generateUidIdentifier("exports").name);const stringSpecifiers=new Set;!function(programPath){programPath.get("body").forEach((child=>{child.isExportDefaultDeclaration()&&(null!=child.splitExportDeclaration||(child.splitExportDeclaration=__webpack_require__("./node_modules/.pnpm/@babel+traverse@7.26.4/node_modules/@babel/traverse/lib/index.js").NodePath.prototype.splitExportDeclaration),child.splitExportDeclaration())}))}(programPath);const{local,sources,hasExports}=function(programPath,{getWrapperPayload,initializeReexports},stringSpecifiers){const localData=function(programPath,initializeReexports,stringSpecifiers){const bindingKindLookup=new Map;programPath.get("body").forEach((child=>{let kind;if(child.isImportDeclaration())kind="import";else{if(child.isExportDefaultDeclaration()&&(child=child.get("declaration")),child.isExportNamedDeclaration())if(child.node.declaration)child=child.get("declaration");else if(initializeReexports&&child.node.source&&child.get("source").isStringLiteral())return void child.get("specifiers").forEach((spec=>{assertExportSpecifier(spec),bindingKindLookup.set(spec.get("local").node.name,"block")}));if(child.isFunctionDeclaration())kind="hoisted";else if(child.isClassDeclaration())kind="block";else if(child.isVariableDeclaration({kind:"var"}))kind="var";else{if(!child.isVariableDeclaration())return;kind="block"}}Object.keys(child.getOuterBindingIdentifiers()).forEach((name=>{bindingKindLookup.set(name,kind)}))}));const localMetadata=new Map,getLocalMetadata=idPath=>{const localName=idPath.node.name;let metadata=localMetadata.get(localName);if(!metadata){const kind=bindingKindLookup.get(localName);if(void 0===kind)throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);metadata={names:[],kind},localMetadata.set(localName,metadata)}return metadata};return programPath.get("body").forEach((child=>{if(!child.isExportNamedDeclaration()||!initializeReexports&&child.node.source){if(child.isExportDefaultDeclaration()){const declaration=child.get("declaration");if(!declaration.isFunctionDeclaration()&&!declaration.isClassDeclaration())throw declaration.buildCodeFrameError("Unexpected default expression export.");getLocalMetadata(declaration.get("id")).names.push("default")}}else if(child.node.declaration){const declaration=child.get("declaration"),ids=declaration.getOuterBindingIdentifierPaths();Object.keys(ids).forEach((name=>{if("__esModule"===name)throw declaration.buildCodeFrameError('Illegal export "__esModule".');getLocalMetadata(ids[name]).names.push(name)}))}else child.get("specifiers").forEach((spec=>{const local=spec.get("local"),exported=spec.get("exported"),localMetadata=getLocalMetadata(local),exportName=getExportSpecifierName(exported,stringSpecifiers);if("__esModule"===exportName)throw exported.buildCodeFrameError('Illegal export "__esModule".');localMetadata.names.push(exportName)}))})),localMetadata}(programPath,initializeReexports,stringSpecifiers),importNodes=new Map,sou Line truncated
(function() {
throw new Error('"' + '${localName}' + '" is read-only.');
})()
`,rewriteReferencesVisitor={ReferencedIdentifier(path){const{seen,buildImportReference,scope,imported,requeueInParent}=this;if(seen.has(path.node))return;seen.add(path.node);const localName=path.node.name,importData=imported.get(localName);if(importData){if(function(path){do{switch(path.parent.type){case"TSTypeAnnotation":case"TSTypeAliasDeclaration":case"TSTypeReference":case"TypeAnnotation":case"TypeAlias":return!0;case"ExportSpecifier":return"type"===path.parentPath.parent.exportKind;default:if(path.parentPath.isStatement()||path.parentPath.isExpression())return!1}}while(path=path.parentPath)}(path))throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`);const localBinding=path.scope.getBinding(localName);if(scope.getBinding(localName)!==localBinding)return;const ref=buildImportReference(importData,path.node);if(ref.loc=path.node.loc,(path.parentPath.isCallExpression({callee:path.node})||path.parentPath.isOptionalCallExpression({callee:path.node})||path.parentPath.isTaggedTemplateExpression({tag:path.node}))&&_core.types.isMemberExpression(ref))path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0),ref]));else if(path.isJSXIdentifier()&&_core.types.isMemberExpression(ref)){const{object,property}=ref;path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name),_core.types.jsxIdentifier(property.name)))}else path.replaceWith(ref);requeueInParent(path),path.skip()}},UpdateExpression(path){const{scope,seen,imported,exported,requeueInParent,buildImportReference}=this;if(seen.has(path.node))return;seen.add(path.node);const arg=path.get("argument");if(arg.isMemberExpression())return;const update=path.node;if(arg.isIdentifier()){const localName=arg.node.name;if(scope.getBinding(localName)!==path.scope.getBinding(localName))return;const exportedNames=exported.get(localName),importData=imported.get(localName);if((null==exportedNames?void 0:exportedNames.length)>0||importData)if(importData)path.replaceWith(_core.types.assignmentExpression(update.operator[0]+"=",buildImportReference(importData,arg.node),buildImportThrow(localName)));else if(update.prefix)path.replaceWith(buildBindingExportAssignmentExpression(this.metadata,exportedNames,_core.types.cloneNode(update),path.scope));else{const ref=scope.generateDeclaredUidIdentifier(localName);path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=",_core.types.cloneNode(ref),_core.types.cloneNode(update)),buildBindingExportAssignmentExpression(this.metadata,exportedNames,_core.types.identifier(localName),path.scope),_core.types.cloneNode(ref)]))}}requeueInParent(path),path.skip()},AssignmentExpression:{exit(path){const{scope,seen,imported,exported,requeueInParent,buildImportReference}=this;if(seen.has(path.node))return;seen.add(path.node);const left=path.get("left");if(!left.isMemberExpression())if(left.isIdentifier()){const localName=left.node.name;if(scope.getBinding(localName)!==path.scope.getBinding(localName))return;const exportedNames=exported.get(localName),importData=imported.get(localName);if((null==exportedNames?void 0:exportedNames.length)>0||importData){const assignment=path.node;importData&&(assignment.left=buildImportReference(importData,left.node),assignment.right=_core.types.sequenceExpression([assignment.right,buildImportThrow(localName)]));const{operator}=assignment;let newExpr;newExpr="="===operator?assignment:"&&="===operator||"||="===operator||"??="===operator?_core.types.assignmentExpression("=",assignment.left,_core.types.logicalExpression(operator.slice(0,-1),_core.types.cloneNode(assignment.left),assignment.right)):_core.types.assignmentExpression("=",assignment.left,_core.types.binaryExpression(operator.slice(0,-1),_core.types.cloneNode(assignment.left),assignment.right)),path.replaceWith(buildBindingExportAssignmentExpression(this.metadata,exportedNames,newExpr,path.scope)),requeueInParent(path),path.skip()}}else{const ids=left.getOuterBindingIdentifiers(),programScopeIds=Object.keys(ids).filter((localName=>scope.getBinding(localName)===path.scope.getBinding(localName))),id=programScopeIds.find((localName=>imported.has(localName)));id&&(path.node.right=_core.types.sequenceExpression([path.node.right,buildImportThrow(id)]));const items=[];if(programScopeIds.forEach((localName=>{const exportedNames=exported.get(localName)||[];exportedNames.length>0&&items.push(buildBindingExportAssignmentExpression(this.metadata,exportedNames,_core.types.identifier(localName),path.scope))})),items.length>0){let node=_core.types.sequenceExpression(items);path.parentPath.isExpressionStatement()&&(node=_core.types.expressionStatement(node),node._blockHoist=path.parentPath.node._blockHoist);requeueInParent(path.insertAfter(node)[0])}}}},ForXStatement(path){const{scope,node}=path,{left}=node,{exported,imported,scope:programScope} Line truncated
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
`]):_core.template.expression.ast`
function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
`}},specHandlers_old={memoise(superMember,count){const{scope,node}=superMember,{computed,property}=node;if(!computed)return;const memo=scope.maybeGenerateMemoised(property);memo&&this.memoiser.set(property,memo,count)},prop(superMember){const{computed,property}=superMember.node;return this.memoiser.has(property)?cloneNode(this.memoiser.get(property)):computed?cloneNode(property):stringLiteral(property.name)},_getPrototypeOfExpression(){const objectRef=cloneNode(this.getObjectRef()),targetRef=this.isStatic||this.isPrivateMethod?objectRef:memberExpression(objectRef,identifier("prototype"));return callExpression(this.file.addHelper("getPrototypeOf"),[targetRef])},get(superMember){return this._get(superMember)},_get(superMember){const proto=this._getPrototypeOfExpression();return callExpression(this.file.addHelper("get"),[this.isDerivedConstructor?sequenceExpression([thisExpression(),proto]):proto,this.prop(superMember),thisExpression()])},set(superMember,value){const proto=this._getPrototypeOfExpression();return callExpression(this.file.addHelper("set"),[this.isDerivedConstructor?sequenceExpression([thisExpression(),proto]):proto,this.prop(superMember),value,thisExpression(),_core.types.booleanLiteral(superMember.isInStrictMode())])},destructureSet(superMember){throw superMember.buildCodeFrameError("Destructuring to a super field is not supported yet.")},call(superMember,args){return(0,_helperOptimiseCallExpression.default)(this._get(superMember),thisExpression(),args,!1)},optionalCall(superMember,args){return(0,_helperOptimiseCallExpression.default)(this._get(superMember),cloneNode(thisExpression()),args,!0)},delete(superMember){return superMember.node.computed?sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"),[cloneNode(superMember.node.property)]),_core.template.expression.ast`
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
`]):_core.template.expression.ast`
function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
`}},looseHandlers=Object.assign({},specHandlers,{prop(superMember){const{property}=superMember.node;return this.memoiser.has(property)?cloneNode(this.memoiser.get(property)):cloneNode(property)},get(superMember){const{isStatic,getSuperRef}=this,{computed}=superMember.node,prop=this.prop(superMember);let object;var _getSuperRef,_getSuperRef2;isStatic?object=null!=(_getSuperRef=getSuperRef())?_getSuperRef:memberExpression(identifier("Function"),identifier("prototype")):object=memberExpression(null!=(_getSuperRef2=getSuperRef())?_getSuperRef2:identifier("Object"),identifier("prototype"));return memberExpression(object,prop,computed)},set(superMember,value){const{computed}=superMember.node,prop=this.prop(superMember);return assignmentExpression("=",memberExpression(thisExpression(),prop,computed),value)},destructureSet(superMember){const{computed}=superMember.node,prop=this.prop(superMember);return memberExpression(thisExpression(),prop,computed)},call(superMember,args){return(0,_helperOptimiseCallExpression.default)(this.get(superMember),thisExpression(),args,!1)},optionalCall(superMember,args){return(0,_helperOptimiseCallExpression.default)(this.get(superMember),thisExpression(),args,!0)}});exports.default=class{constructor(opts){var _opts$constantSuper;const path=opts.methodPath;this.methodPath=path,this.isDerivedConstructor=path.isClassMethod({kind:"constructor"})&&!!opts.superRef,this.isStatic=path.isObjectMethod()||path.node.static||(null==path.isStaticBlock?void 0:path.isStaticBlock()),this.isPrivateMethod=path.isPrivate()&&path.isMethod(),this.file=opts.file,this.constantSuper=null!=(_opts$constantSuper=opts.constantSuper)?_opts$constantSuper:opts.isLoose,this.opts=opts}getObjectRef(){return cloneNode(this.opts.objectRef||this.opts.getObjectRef())}getSuperRef(){return this.opts.superRef?cloneNode(this.opts.superRef):this.opts.getSuperRef?cloneNode(this.opts.getSuperRef()):void 0}replace(){const{methodPath}=this;this.opts.refToPreserve&&methodPath.traverse(unshadowSuperBindingVisitor,{refName:this.opts.refToPreserve.name});const handler=this.constantSuper?looseHandlers:this.file.availableHelper("superPropSet")?specHandlers:specHandlers_old;visitor.shouldSkip=path=>{if(path.parentPath===methodPath&&("decorators"===path.parentKey||"key"===path.parentKey))return!0},(0,_helperMemberExpressionToFunctions.default)(methodPath,visitor,Object.assign({file:this.file,scope:this.methodPath.scope,isDerivedConstructor:this.isDerivedConstructor,isStatic:this.isStatic,isPrivateMethod:this.isPrivateMethod,getObjectRef:this.getObjectRef.bind(this),getSuperRef:this.getSuperRef.bind(this),boundGet:handler.get},handler))}}},"./node_modules/.pnpm/@babel+helper-simple-access@7.25.9/node_modules/@babel/helper-simple-access/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";exports.A=function(path,bindingNames){var _arguments$;path.traverse(simpleAssignmentVisitor,{scope:path.scope,bindingNames,seen:new WeakSet,includeUpdateExpression:null==(_arguments$=arguments[2])||_arguments$})};var _t=__webpack_require__("./node_modules/.pnpm/@babel+types@7.26.3/node_modules/@babel/types/lib/index.js");const{LOGICAL_OPERATORS,assignmentExpression,binaryExpression,cloneNode,identifier,logicalExpression,numericLiteral,sequenceExpression,unaryExpression}=_t,simpleAssignmentVisitor={AssignmentExpression:{exit(path){const{scope,seen,bindingNames}=this;if("="===path.node.operator)return;if(seen.has(path.node))return;seen.add(path.node);const left=path.get("left");if(!left.isIdentifier())return;const localName=left.node.name;if(!bindingNames.has(localName))return;if(scope.getBinding(localName)!==path.scope.getBinding(localName))return;const operator=path.node.operator.slice(0,-1);LOGICAL_OPERATORS.includes(operator)?path.replaceWith(logicalExpression(operator,path.node.left,assignmentExpression("=",cloneNode(path.node.left),path.node.right))):(path.node.right=binaryExpression(operator,cloneNode(path.node.left),path.node.right),path.node.operator="=")}}};simpleAssignmentVisitor.UpdateExpression={exit(path){if(!this.includeUpdateExpression)return;const{scope,bindingNames}=this,arg=path.get("argument");if(!arg.isIdentifier())return;const localName=arg.node.name;if(bindingNames.has(localName)&&scope.getBinding(localName)===path.scope.getBinding(localName))if(path.parentPath.isExpressionStatement()&&!path.isCompletionRecord()){const operator="++"===path.node.operator?"+=":"-=";path.replaceWith(assignmentExpression(operator,arg.node,numericLiteral(1)))}else if(path.node.prefix)path.replaceWith(assignmentExpression("=",identifier(localName),binaryExpression(path.node.operator[0],unaryExpression("+",arg.node),numericLiteral(1))));else{const old=path.scope.generateUidIdentifierBasedOnNode(arg.node,"old"),varName=old.name;path.scope.push({id:old});const binary=binaryExpression(path.node.operator[0],identifier(varName),numericLiteral(1));path.replaceWith(sequenceExpression([assignmentExpression("=",identifier(varName),u Line truncated
(function(){
throw new Error(
"The CommonJS '" + "${localName}" + "' variable is not available in ES6 modules." +
"Consider setting setting sourceType:script or sourceType:unambiguous in your " +
"Babel config for this file.");
})()
`,moduleExportsVisitor={ReferencedIdentifier(path){const localName=path.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);this.scope.getBinding(localName)!==localBinding||path.parentPath.isObjectProperty({value:path.node})&&path.parentPath.parentPath.isObjectPattern()||path.parentPath.isAssignmentExpression({left:path.node})||path.isAssignmentExpression({left:path.node})||path.replaceWith(getAssertion(localName))},UpdateExpression(path){const arg=path.get("argument");if(!arg.isIdentifier())return;const localName=arg.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);this.scope.getBinding(localName)===localBinding&&path.replaceWith(_core.types.assignmentExpression(path.node.operator[0]+"=",arg.node,getAssertion(localName)))},AssignmentExpression(path){const left=path.get("left");if(left.isIdentifier()){const localName=left.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);if(this.scope.getBinding(localName)!==localBinding)return;const right=path.get("right");right.replaceWith(_core.types.sequenceExpression([right.node,getAssertion(localName)]))}else if(left.isPattern()){const ids=left.getOuterBindingIdentifiers(),localName=Object.keys(ids).find((localName=>("module"===localName||"exports"===localName)&&this.scope.getBinding(localName)===path.scope.getBinding(localName)));if(localName){const right=path.get("right");right.replaceWith(_core.types.sequenceExpression([right.node,getAssertion(localName)]))}}}};return{name:"transform-modules-commonjs",pre(){this.file.set("@babel/plugin-transform-modules-*","commonjs"),lazy&&(0,_hooks.defineCommonJSHook)(this.file,(0,_lazy.lazyImportsHook)(lazy))},visitor:{["CallExpression"+(api.types.importExpression?"|ImportExpression":"")](path){if(!this.file.has("@babel/plugin-proposal-dynamic-import"))return;if(path.isCallExpression()&&!_core.types.isImport(path.node.callee))return;let{scope}=path;do{scope.rename("require")}while(scope=scope.parent);(0,_dynamicImport.transformDynamicImport)(path,noInterop,this.file)},Program:{exit(path,state){if(!(0,_helperModuleTransforms.isModule)(path))return;path.scope.rename("exports"),path.scope.rename("module"),path.scope.rename("require"),path.scope.rename("__filename"),path.scope.rename("__dirname"),allowCommonJSExports||path.traverse(moduleExportsVisitor,{scope:path.scope});let moduleName=(0,_helperModuleTransforms.getModuleName)(this.file.opts,options);moduleName&&(moduleName=_core.types.stringLiteral(moduleName));const hooks=(0,_hooks.makeInvokers)(this.file),{meta,headers}=(0,_helperModuleTransforms.rewriteModuleStatementsAndPrepareHeader)(path,{exportName:"exports",constantReexports,enumerableModuleMeta,strict,strictMode,allowTopLevelThis,noInterop,importInterop,wrapReference:hooks.wrapReference,getWrapperPayload:hooks.getWrapperPayload,esNamespaceOnly:"string"==typeof state.filename&&/\.mjs$/.test(state.filename)?mjsStrictNamespace:strictNamespace,noIncompleteNsImportDetection,filename:this.file.opts.filename});for(const[source,metadata]of meta.source){const loadExpr=_core.types.callExpression(_core.types.identifier("require"),[_core.types.stringLiteral(source)]);let header;if((0,_helperModuleTransforms.isSideEffectImport)(metadata)){if(lazy&&"function"===metadata.wrap)throw new Error("Assertion failure");header=_core.types.expressionStatement(loadExpr)}else{const init=(0,_helperModuleTransforms.wrapInterop)(path,loadExpr,metadata.interop)||loadExpr;if(metadata.wrap){const res=hooks.buildRequireWrapper(metadata.name,init,metadata.wrap,metadata.referenced);if(!1===res)continue;header=res}null!=header||(header=_core.template.statement.ast`
var ${metadata.name} = ${init};
`)}header.loc=metadata.loc,headers.push(header),headers.push(...(0,_helperModuleTransforms.buildNamespaceInitStatements)(meta,metadata,constantReexports,hooks.wrapReference))}(0,_helperModuleTransforms.ensureStatementsHoisted)(headers),path.unshiftContainer("body",headers),path.get("body").forEach((path=>{headers.includes(path.node)&&path.isVariableDeclaration()&&path.scope.registerDeclaration(path)}))}}}}}))},"./node_modules/.pnpm/@babel+plugin-transform-modules-commonjs@7.26.3_@babel+core@7.26.0/node_modules/@babel/plugin-transform-modules-commonjs/lib/lazy.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.lazyImportsHook=void 0;var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_helperModuleTransforms=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/index.js");exports.lazyImportsHook=lazy=>({name:"@babel/plugin-transform-modules-commonjs/lazy",version:"7.26.3",getWrapperPayload:(source,metadata)=>(0,_helperModuleTransforms.isSideEffectImport)(metadata)||metadata.reexportAll?null:!0===lazy?source.includes(".")?null:"lazy/function":Array.isArray(lazy)?lazy.includes(source)?"lazy/function":null:"function"==typeof lazy?lazy(source)?"lazy/function":null:void 0,buildRequireWrapper(name,init,payload,referenced){if("lazy/function"===payload)return!!referenced&&_core.template.statement.ast`
function ${name}() {
const data = ${init};
${name} = function(){ return data; };
return data;
}
`},wrapReference(ref,payload){if("lazy/function"===payload)return _core.types.callExpression(ref,[])}})},"./node_modules/.pnpm/@babel+plugin-transform-react-jsx@7.25.9_@babel+core@7.26.0/node_modules/@babel/plugin-transform-react-jsx/lib/create-plugin.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function({name,development}){return(0,_helperPluginUtils.declare)(((_,options)=>{const{pure:PURE_ANNOTATION,throwIfNamespace=!0,filter,runtime:RUNTIME_DEFAULT=(development?"automatic":"classic"),importSource:IMPORT_SOURCE_DEFAULT=DEFAULT.importSource,pragma:PRAGMA_DEFAULT=DEFAULT.pragma,pragmaFrag:PRAGMA_FRAG_DEFAULT=DEFAULT.pragmaFrag}=options;var{useSpread=!1,useBuiltIns=!1}=options;if("classic"===RUNTIME_DEFAULT){if("boolean"!=typeof useSpread)throw new Error("transform-react-jsx currently only accepts a boolean option for useSpread (defaults to false)");if("boolean"!=typeof useBuiltIns)throw new Error("transform-react-jsx currently only accepts a boolean option for useBuiltIns (defaults to false)");if(useSpread&&useBuiltIns)throw new Error("transform-react-jsx currently only accepts useBuiltIns or useSpread but not both")}const injectMetaPropertiesVisitor={JSXOpeningElement(path,state){const attributes=[];(function(scope){do{const{path}=scope;if(path.isFunctionParent()&&!path.isArrowFunctionExpression())return!path.isMethod()||("constructor"!==path.node.kind||!isDerivedClass(path.parentPath.parentPath));if(path.isTSModuleBlock())return!1}while(scope=scope.parent);return!0})(path.scope)&&attributes.push(_core.types.jsxAttribute(_core.types.jsxIdentifier("__self"),_core.types.jsxExpressionContainer(_core.types.thisExpression()))),attributes.push(_core.types.jsxAttribute(_core.types.jsxIdentifier("__source"),_core.types.jsxExpressionContainer(function(path,state){const location=path.node.loc;if(!location)return path.scope.buildUndefinedNode();if(!state.fileNameIdentifier){const{filename=""}=state,fileNameIdentifier=path.scope.generateUidIdentifier("_jsxFileName");path.scope.getProgramParent().push({id:fileNameIdentifier,init:_core.types.stringLiteral(filename)}),state.fileNameIdentifier=fileNameIdentifier}return function(fileNameIdentifier,lineNumber,column0Based){const fileLineLiteral=null!=lineNumber?_core.types.numericLiteral(lineNumber):_core.types.nullLiteral(),fileColumnLiteral=null!=column0Based?_core.types.numericLiteral(column0Based+1):_core.types.nullLiteral();return _core.template.expression.ast`{
fileName: ${fileNameIdentifier},
lineNumber: ${fileLineLiteral},
columnNumber: ${fileColumnLiteral},
}`}(_core.types.cloneNode(state.fileNameIdentifier),location.start.line,location.start.column)}(path,state)))),path.pushContainer("attributes",attributes)}};return{name,inherits:_pluginSyntaxJsx.default,visitor:{JSXNamespacedName(path){if(throwIfNamespace)throw path.buildCodeFrameError("Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can set `throwIfNamespace: false` to bypass this warning.")},JSXSpreadChild(path){throw path.buildCodeFrameError("Spread children are not supported in React.")},Program:{enter(path,state){const{file}=state;let runtime=RUNTIME_DEFAULT,source=IMPORT_SOURCE_DEFAULT,pragma=PRAGMA_DEFAULT,pragmaFrag=PRAGMA_FRAG_DEFAULT,sourceSet=!!options.importSource,pragmaSet=!!options.pragma,pragmaFragSet=!!options.pragmaFrag;if(file.ast.comments)for(const comment of file.ast.comments){const sourceMatches=JSX_SOURCE_ANNOTATION_REGEX.exec(comment.value);sourceMatches&&(source=sourceMatches[1],sourceSet=!0);const runtimeMatches=JSX_RUNTIME_ANNOTATION_REGEX.exec(comment.value);runtimeMatches&&(runtime=runtimeMatches[1]);const jsxMatches=JSX_ANNOTATION_REGEX.exec(comment.value);jsxMatches&&(pragma=jsxMatches[1],pragmaSet=!0);const jsxFragMatches=JSX_FRAG_ANNOTATION_REGEX.exec(comment.value);jsxFragMatches&&(pragmaFrag=jsxFragMatches[1],pragmaFragSet=!0)}if(set(state,"runtime",runtime),"classic"===runtime){if(sourceSet)throw path.buildCodeFrameError("importSource cannot be set when runtime is classic.");const createElement=toMemberExpression(pragma),fragment=toMemberExpression(pragmaFrag);set(state,"id/createElement",(()=>_core.types.cloneNode(createElement))),set(state,"id/fragment",(()=>_core.types.cloneNode(fragment))),set(state,"defaultPure",pragma===DEFAULT.pragma)}else{if("automatic"!==runtime)throw path.buildCodeFrameError('Runtime must be either "classic" or "automatic".');{if(pragmaSet||pragmaFragSet)throw path.buildCodeFrameError("pragma and pragmaFrag cannot be set when runtime is automatic.");const define=(name,id)=>set(state,name,function(pass,path,importName,source){return()=>{const actualSource=function(source,importName){switch(importName){case"Fragment":return`${source}/${development?"jsx-dev-runtime":"jsx-runtime"}`;case"jsxDEV":return`${source}/jsx-dev-runtime`;case"jsx":case"jsxs":return`${source}/jsx-runtime`;case"createElement":return source}}(source,importName);if((0,_helperModuleImports.isModule)(path)){let reference=get(pass,`imports/${importName}`);return reference?_core.types.cloneNode(reference):(reference=(0,_helperModuleImports.addNamed)(path,importName,actualSource,{importedInterop:"uncompiled",importPosition:"after"}),set(pass,`imports/${importName}`,reference),reference)}{let reference=get(pass,`requires/${actualSource}`);return reference?reference=_core.types.cloneNode(reference):(reference=(0,_helperModuleImports.addNamespace)(path,actualSource,{importedInterop:"uncompiled"}),set(pass,`requires/${actualSource}`,reference)),_core.types.memberExpression(reference,_core.types.identifier(importName))}}}(state,path,id,source));define("id/jsx",development?"jsxDEV":"jsx"),define("id/jsxs",development?"jsxDEV":"jsxs"),define("id/createElement","createElement"),define("id/fragment","Fragment"),set(state,"defaultPure",source===DEFAULT.importSource)}}development&&path.traverse(injectMetaPropertiesVisitor,state)}},JSXFragment:{exit(path,file){let callExpr;callExpr="classic"===get(file,"runtime")?function(path,file){if(filter&&!filter(path.node,file))return;return call(file,"createElement",[get(file,"id/fragment")(),_core.types.nullLiteral(),..._core.types.react.buildChildren(path.node)])}(path,file):function(path,file){const args=[get(file,"id/fragment")()],children=_core.types.react.buildChildren(path.node);args.push(_core.types.objectExpression(children.length>0?[buildChildrenProperty(children)]:[])),development&&args.push(path.scope.buildUndefinedNode(),_core.types.booleanLiteral(children.length>1));return call(file,children.length>1?"jsxs":"jsx",args)}(path,file),path.replaceWith(_core.types.inherits(callExpr,path.node))}},JSXElement:{exit(path,file){let callExpr;callExpr="classic"===get(file,"runtime")||function(path){const openingPath=path.get("openingElement"),attributes=openingPath.node.attributes;let seenPropsSpread=!1;for(let i=0;i<attributes.length;i++){const attr=attributes[i];if(seenPropsSpread&&_core.types.isJSXAttribute(attr)&&"key"===attr.name.name)return!0;_core.types.isJSXSpreadAttribute(attr)&&(seenPropsSpread=!0)}return!1}(path)?function(path,file){const openingPath=path.get("openingElement");return call(file,"createElement",[getTag(openingPath),buildCreateElementOpeningElementAttributes(file,path,openingPath.get("attributes")),..._core.types.react.buildChildren(path.node)])}(path,file):function(path,file){const openingPath=path.get("openingElement"),args=[getTag(openingPath)],attribsArray=[],extracted=Object.create(null);for(const attr of openingPath.get("attributes"))if(attr.isJSXAttribute()&&_core.types.isJSX Line truncated
this.${t.cloneNode(id)} = ${t.cloneNode(id)}
`),paramPath.replaceWith(paramPath.get("parameter")),scope.registerBinding("param",paramPath)}}(0,_helperCreateClassFeaturesPlugin.injectInitialization)(classPath,path,assigns)}};return{name:"transform-typescript",inherits:_pluginSyntaxTypescript.default,visitor:{Pattern:visitPattern,Identifier:visitPattern,RestElement:visitPattern,Program:{enter(path,state){const{file}=state;let fileJsxPragma=null,fileJsxPragmaFrag=null;const programScope=path.scope;if(_globalTypes.GLOBAL_TYPES.has(programScope)||_globalTypes.GLOBAL_TYPES.set(programScope,new Set),file.ast.comments)for(const comment of file.ast.comments){const jsxMatches=JSX_PRAGMA_REGEX.exec(comment.value);jsxMatches&&(jsxMatches[1]?fileJsxPragmaFrag=jsxMatches[2]:fileJsxPragma=jsxMatches[2])}let pragmaImportName=fileJsxPragma||jsxPragma;pragmaImportName&&([pragmaImportName]=pragmaImportName.split("."));let pragmaFragImportName=fileJsxPragmaFrag||jsxPragmaFrag;pragmaFragImportName&&([pragmaFragImportName]=pragmaFragImportName.split("."));for(let stmt of path.get("body"))if(stmt.isImportDeclaration()){if(NEEDS_EXPLICIT_ESM.has(state.file.ast.program)||NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!0),"type"===stmt.node.importKind){for(const specifier of stmt.node.specifiers)(0,_globalTypes.registerGlobalType)(programScope,specifier.local.name);stmt.remove();continue}const importsToRemove=new Set,specifiersLength=stmt.node.specifiers.length,isAllSpecifiersElided=()=>specifiersLength>0&&specifiersLength===importsToRemove.size;for(const specifier of stmt.node.specifiers)if("ImportSpecifier"===specifier.type&&"type"===specifier.importKind){(0,_globalTypes.registerGlobalType)(programScope,specifier.local.name);const binding=stmt.scope.getBinding(specifier.local.name);binding&&importsToRemove.add(binding.path)}if(onlyRemoveTypeImports)NEEDS_EXPLICIT_ESM.set(path.node,!1);else{if(0===stmt.node.specifiers.length){NEEDS_EXPLICIT_ESM.set(path.node,!1);continue}for(const specifier of stmt.node.specifiers){const binding=stmt.scope.getBinding(specifier.local.name);binding&&!importsToRemove.has(binding.path)&&(isImportTypeOnly({binding,programPath:path,pragmaImportName,pragmaFragImportName})?importsToRemove.add(binding.path):NEEDS_EXPLICIT_ESM.set(path.node,!1))}}if(isAllSpecifiersElided()&&!onlyRemoveTypeImports)stmt.remove();else for(const importPath of importsToRemove)importPath.remove()}else if(stmt.isExportDeclaration()&&(stmt=stmt.get("declaration")),stmt.isVariableDeclaration({declare:!0}))for(const name of Object.keys(stmt.getBindingIdentifiers()))(0,_globalTypes.registerGlobalType)(programScope,name);else(stmt.isTSTypeAliasDeclaration()||stmt.isTSDeclareFunction()&&stmt.get("id").isIdentifier()||stmt.isTSInterfaceDeclaration()||stmt.isClassDeclaration({declare:!0})||stmt.isTSEnumDeclaration({declare:!0})||stmt.isTSModuleDeclaration({declare:!0})&&stmt.get("id").isIdentifier())&&(0,_globalTypes.registerGlobalType)(programScope,stmt.node.id.name)},exit(path){"module"===path.node.sourceType&&NEEDS_EXPLICIT_ESM.get(path.node)&&path.pushContainer("body",t.exportNamedDeclaration())}},ExportNamedDeclaration(path,state){if(NEEDS_EXPLICIT_ESM.has(state.file.ast.program)||NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!0),"type"!==path.node.exportKind)if(path.node.source&&path.node.specifiers.length>0&&path.node.specifiers.every((specifier=>"ExportSpecifier"===specifier.type&&"type"===specifier.exportKind)))path.remove();else if(!path.node.source&&path.node.specifiers.length>0&&path.node.specifiers.every((specifier=>t.isExportSpecifier(specifier)&&(0,_globalTypes.isGlobalType)(path,specifier.local.name))))path.remove();else{if(t.isTSModuleDeclaration(path.node.declaration)){const namespace=path.node.declaration;if(!t.isStringLiteral(namespace.id)){const id=(0,_namespace.getFirstIdentifier)(namespace.id);if(path.scope.hasOwnBinding(id.name))path.replaceWith(namespace);else{const[newExport]=path.replaceWithMultiple([t.exportNamedDeclaration(t.variableDeclaration("let",[t.variableDeclarator(t.cloneNode(id))])),namespace]);path.scope.registerDeclaration(newExport)}}}NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!1)}else path.remove()},ExportAllDeclaration(path){"type"===path.node.exportKind&&path.remove()},ExportSpecifier(path){(!path.parent.source&&(0,_globalTypes.isGlobalType)(path,path.node.local.name)||"type"===path.node.exportKind)&&path.remove()},ExportDefaultDeclaration(path,state){NEEDS_EXPLICIT_ESM.has(state.file.ast.program)||NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!0),t.isIdentifier(path.node.declaration)&&(0,_globalTypes.isGlobalType)(path,path.node.declaration.name)?path.remove():NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!1)},TSDeclareFunction(path){safeRemove(path)},TSDeclareMethod(path){safeRemove(path)},VariableDeclaration(path){path.node.declare&&safeRemove(path)},VariableDeclarator({node}){node.definite&&(node.definite=null)},TSIndexSignature(path){path.remove()},ClassDeclaration(path){const{node}=path;node.declare&&safeRemove(path)},C Line truncated
${_core.types.cloneNode(memberExpr)} ||
(${_core.types.cloneNode(memberExpr)} = ${fallthroughValue})
`}return _core.template.statement.ast`
(function (${_core.types.identifier(name)}) {
${namespaceTopLevel}
})(${realName} || (${_core.types.cloneNode(realName)} = ${fallthroughValue}));
`}},"./node_modules/.pnpm/@babel+preset-typescript@7.26.0_@babel+core@7.26.0/node_modules/@babel/preset-typescript/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helperPluginUtils=__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.25.9/node_modules/@babel/helper-plugin-utils/lib/index.js"),transformTypeScript=__webpack_require__("./node_modules/.pnpm/@babel+plugin-transform-typescript@7.26.3_@babel+core@7.26.0/node_modules/@babel/plugin-transform-typescript/lib/index.js");__webpack_require__("./node_modules/.pnpm/@babel+plugin-syntax-jsx@7.25.9_@babel+core@7.26.0/node_modules/@babel/plugin-syntax-jsx/lib/index.js");var transformModulesCommonJS=__webpack_require__("./node_modules/.pnpm/@babel+plugin-transform-modules-commonjs@7.26.3_@babel+core@7.26.0/node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js"),helperValidatorOption=__webpack_require__("./node_modules/.pnpm/@babel+helper-validator-option@7.25.9/node_modules/@babel/helper-validator-option/lib/index.js");function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var transformTypeScript__default=_interopDefault(transformTypeScript),transformModulesCommonJS__default=_interopDefault(transformModulesCommonJS);const v=new helperValidatorOption.OptionValidator("@babel/preset-typescript");var pluginRewriteTSImports=helperPluginUtils.declare((function({types:t,template}){function maybeReplace(source,path){source&&(t.isStringLiteral(source)?/[\\/]/.test(source.value)&&(source.value=source.value.replace(/(\.[mc]?)ts$/,"$1js").replace(/\.tsx$/,".js")):path.replaceWith(template.expression.ast`(${source} + "").replace(/([\\/].*\.[mc]?)tsx?$/, "$1js")`))}return{name:"preset-typescript/plugin-rewrite-ts-imports",visitor:{"ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration"(path){const node=path.node;"value"===(t.isImportDeclaration(node)?node.importKind:node.exportKind)&&maybeReplace(node.source,path.get("source"))},CallExpression(path){t.isImport(path.node.callee)&&maybeReplace(path.node.arguments[0],path.get("arguments.0"))},ImportExpression(path){maybeReplace(path.node.source,path.get("source"))}}}})),index=helperPluginUtils.declarePreset(((api,opts)=>{api.assertVersion(7);const{allExtensions,ignoreExtensions,allowNamespaces,disallowAmbiguousJSXLike,isTSX,jsxPragma,jsxPragmaFrag,onlyRemoveTypeImports,optimizeConstEnums,rewriteImportExtensions}=function(options={}){let{allowNamespaces=!0,jsxPragma,onlyRemoveTypeImports}=options;const TopLevelOptions_ignoreExtensions="ignoreExtensions",TopLevelOptions_disallowAmbiguousJSXLike="disallowAmbiguousJSXLike",TopLevelOptions_jsxPragmaFrag="jsxPragmaFrag",TopLevelOptions_optimizeConstEnums="optimizeConstEnums",TopLevelOptions_rewriteImportExtensions="rewriteImportExtensions",TopLevelOptions_allExtensions="allExtensions",TopLevelOptions_isTSX="isTSX",jsxPragmaFrag=v.validateStringOption(TopLevelOptions_jsxPragmaFrag,options.jsxPragmaFrag,"React.Fragment");var allExtensions=v.validateBooleanOption(TopLevelOptions_allExtensions,options.allExtensions,!1),isTSX=v.validateBooleanOption(TopLevelOptions_isTSX,options.isTSX,!1);isTSX&&v.invariant(allExtensions,"isTSX:true requires allExtensions:true");const ignoreExtensions=v.validateBooleanOption(TopLevelOptions_ignoreExtensions,options.ignoreExtensions,!1),disallowAmbiguousJSXLike=v.validateBooleanOption(TopLevelOptions_disallowAmbiguousJSXLike,options.disallowAmbiguousJSXLike,!1);disallowAmbiguousJSXLike&&v.invariant(allExtensions,"disallowAmbiguousJSXLike:true requires allExtensions:true");const normalized={ignoreExtensions,allowNamespaces,disallowAmbiguousJSXLike,jsxPragma,jsxPragmaFrag,onlyRemoveTypeImports,optimizeConstEnums:v.validateBooleanOption(TopLevelOptions_optimizeConstEnums,options.optimizeConstEnums,!1),rewriteImportExtensions:v.validateBooleanOption(TopLevelOptions_rewriteImportExtensions,options.rewriteImportExtensions,!1)};return normalized.allExtensions=allExtensions,normalized.isTSX=isTSX,normalized}(opts),pluginOptions=disallowAmbiguousJSXLike=>({allowDeclareFields:opts.allowDeclareFields,allowNamespaces,disallowAmbiguousJSXLike,jsxPragma,jsxPragmaFrag,onlyRemoveTypeImports,optimizeConstEnums}),getPlugins=(isTSX,disallowAmbiguousJSXLike)=>[[transformTypeScript__default.default,Object.assign({isTSX},pluginOptions(disallowAmbiguousJSXLike))]];return{plugins:rewriteImportExtensions?[pluginRewriteTSImports]:[],overrides:allExtensions||ignoreExtensions?[{plugins:getPlugins(isTSX,disallowAmbiguousJSXLike)}]:[{test:/\.ts$/,plugins:getPlugins(!1,!1)},{test:/\.mts$/,sourceType:"module",plugins:getPlugins(!1,!0)},{test:/\.cts$/,sourceType:"unambiguous",plugins:[[transformModulesCommonJS__default.default,{allowTopLevelThis:!0}],[transformTypeScript__default.default,pluginOptions(!0)]]},{test:/\.tsx$/,plugins:getPlugins(!0,!1)}]}}));exports.default=index},"./node_modules/.pnpm/@babel+template@7.25.9/node_modules/@babel/tem Line truncated
(function (${key}) {
function ${id}(${params}) {
return ${cloneNode(key)}.apply(this, arguments);
}
${cloneNode(id)}.toString = function () {
return ${cloneNode(key)}.toString();
}
return ${cloneNode(id)};
})(${toExpression(this.node)})
`;return this.replaceWith(call)[0].get("arguments.0")},exports.splitExportDeclaration=function(){if(!this.isExportDeclaration()||this.isExportAllDeclaration())throw new Error("Only default and named export declarations can be split.");if(this.isExportNamedDeclaration()&&this.get("specifiers").length>0)throw new Error("It doesn't make sense to split exported specifiers.");const declaration=this.get("declaration");if(this.isExportDefaultDeclaration()){const standaloneDeclaration=declaration.isFunctionDeclaration()||declaration.isClassDeclaration(),exportExpr=declaration.isFunctionExpression()||declaration.isClassExpression(),scope=declaration.isScope()?declaration.scope.parent:declaration.scope;let id=declaration.node.id,needBindingRegistration=!1;id?exportExpr&&scope.hasBinding(id.name)&&(needBindingRegistration=!0,id=scope.generateUidIdentifier(id.name)):(needBindingRegistration=!0,id=scope.generateUidIdentifier("default"),(standaloneDeclaration||exportExpr)&&(declaration.node.id=cloneNode(id)));const updatedDeclaration=standaloneDeclaration?declaration.node:variableDeclaration("var",[variableDeclarator(cloneNode(id),declaration.node)]),updatedExportDeclaration=exportNamedDeclaration(null,[exportSpecifier(cloneNode(id),identifier("default"))]);return this.insertAfter(updatedExportDeclaration),this.replaceWith(updatedDeclaration),needBindingRegistration&&scope.registerDeclaration(this),this}if(this.get("specifiers").length>0)throw new Error("It doesn't make sense to split exported specifiers.");const bindingIdentifiers=declaration.getOuterBindingIdentifiers(),specifiers=Object.keys(bindingIdentifiers).map((name=>exportSpecifier(identifier(name),identifier(name)))),aliasDeclar=exportNamedDeclaration(null,specifiers);return this.insertAfter(aliasDeclar),this.replaceWith(declaration.node),this},exports.toComputedKey=function(){let key;if(this.isMemberExpression())key=this.node.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");key=this.node.key}this.node.computed||isIdentifier(key)&&(key=stringLiteral(key.name));return key},exports.unwrapFunctionEnvironment=function(){if(!this.isArrowFunctionExpression()&&!this.isFunctionExpression()&&!this.isFunctionDeclaration())throw this.buildCodeFrameError("Can only unwrap the environment of a function.");hoistFunctionEnvironment(this)};var _t=__webpack_require__("./node_modules/.pnpm/@babel+types@7.26.3/node_modules/@babel/types/lib/index.js"),_template=__webpack_require__("./node_modules/.pnpm/@babel+template@7.25.9/node_modules/@babel/template/lib/index.js"),_visitors=__webpack_require__("./node_modules/.pnpm/@babel+traverse@7.26.4/node_modules/@babel/traverse/lib/visitors.js"),_context=__webpack_require__("./node_modules/.pnpm/@babel+traverse@7.26.4/node_modules/@babel/traverse/lib/path/context.js");const{arrowFunctionExpression,assignmentExpression,binaryExpression,blockStatement,callExpression,conditionalExpression,expressionStatement,identifier,isIdentifier,jsxIdentifier,logicalExpression,LOGICAL_OPERATORS,memberExpression,metaProperty,numericLiteral,objectExpression,restElement,returnStatement,sequenceExpression,spreadElement,stringLiteral,super:_super,thisExpression,toExpression,unaryExpression,toBindingIdentifierName,isFunction,isAssignmentPattern,isRestElement,getFunctionName,cloneNode,variableDeclaration,variableDeclarator,exportNamedDeclaration,exportSpecifier,inherits}=_t;exports.arrowFunctionToShadowed=function(){this.isArrowFunctionExpression()&&this.arrowFunctionToExpression()};const getSuperCallsVisitor=(0,_visitors.environmentVisitor)({CallExpression(child,{allSuperCalls}){child.get("callee").isSuper()&&allSuperCalls.push(child)}});function hoistFunctionEnvironment(fnPath,noNewArrows=!0,allowInsertArrow=!0,allowInsertArrowWithRest=!0){let arrowParent,thisEnvFn=fnPath.findParent((p=>p.isArrowFunctionExpression()?(null!=arrowParent||(arrowParent=p),!1):p.isFunction()||p.isProgram()||p.isClassProperty({static:!1})||p.isClassPrivateProperty({static:!1})));const inConstructor=thisEnvFn.isClassMethod({kind:"constructor"});if(thisEnvFn.isClassProperty()||thisEnvFn.isClassPrivateProperty())if(arrowParent)thisEnvFn=arrowParent;else{if(!allowInsertArrow)throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property");fnPath.replaceWith(callExpression(arrowFunctionExpression([],toExpression(fnPath.node)),[])),thisEnvFn=fnPath.get("callee"),fnPath=thisEnvFn.get("body")}const{thisPaths,argumentsPaths,newTargetPaths,superProps,superCalls}=function(fnPath){const thisPaths=[],argumentsPaths=[],newTargetPaths=[],superProps=[],superCalls=[];return fnPath.traverse(getScopeInformationVisitor,{thisPaths,argumentsPaths,newTargetPaths,superProps,superCalls}),{thisPaths,argumentsPaths,newTargetPaths,superProps,superCalls}}(fnPath);if(inConstructor&&superCalls.length>0){if(!allowInsertArrow)throw superCalls[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', it's not possible to compile `super()`Line truncated
(function(){
throw new Error(
"The CommonJS '" + "${localName}" + "' variable is not available in ES6 modules." +
"Consider setting setting sourceType:script or sourceType:unambiguous in your " +
"Babel config for this file.");
})()
`,moduleExportsVisitor={ReferencedIdentifier(path){const localName=path.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);this.scope.getBinding(localName)!==localBinding||path.parentPath.isObjectProperty({value:path.node})&&path.parentPath.parentPath.isObjectPattern()||path.parentPath.isAssignmentExpression({left:path.node})||path.isAssignmentExpression({left:path.node})||path.replaceWith(getAssertion(localName))},UpdateExpression(path){const arg=path.get("argument");if(!arg.isIdentifier())return;const localName=arg.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);this.scope.getBinding(localName)===localBinding&&path.replaceWith(lib.types.assignmentExpression(path.node.operator[0]+"=",arg.node,getAssertion(localName)))},AssignmentExpression(path){const left=path.get("left");if(left.isIdentifier()){const localName=left.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);if(this.scope.getBinding(localName)!==localBinding)return;const right=path.get("right");right.replaceWith(lib.types.sequenceExpression([right.node,getAssertion(localName)]))}else if(left.isPattern()){const ids=left.getOuterBindingIdentifiers(),localName=Object.keys(ids).find((localName=>("module"===localName||"exports"===localName)&&this.scope.getBinding(localName)===path.scope.getBinding(localName)));if(localName){const right=path.get("right");right.replaceWith(lib.types.sequenceExpression([right.node,getAssertion(localName)]))}}}};return{name:"transform-modules-commonjs",pre(){this.file.set("@babel/plugin-transform-modules-*","commonjs"),lazy&&function(file,hook){let hooks=file.get(commonJSHooksKey);hooks||file.set(commonJSHooksKey,hooks=[]),hooks.push(hook)}(this.file,(lazy=>({name:"babel-plugin-transform-modules-commonjs/lazy",version:"7.24.7",getWrapperPayload:(source,metadata)=>(0,helper_module_transforms_lib.isSideEffectImport)(metadata)||metadata.reexportAll?null:!0===lazy?source.includes(".")?null:"lazy/function":Array.isArray(lazy)?lazy.includes(source)?"lazy/function":null:"function"==typeof lazy?lazy(source)?"lazy/function":null:void 0,buildRequireWrapper(name,init,payload,referenced){if("lazy/function"===payload)return!!referenced&&lib.template.statement.ast`
function ${name}() {
const data = ${init};
${name} = function(){ return data; };
return data;
}
`},wrapReference(ref,payload){if("lazy/function"===payload)return lib.types.callExpression(ref,[])}}))(lazy))},visitor:{["CallExpression"+(api.types.importExpression?"|ImportExpression":"")](path){if(path.isCallExpression()&&!lib.types.isImport(path.node.callee))return;let{scope}=path;do{scope.rename("require")}while(scope=scope.parent);transformDynamicImport(path,noInterop,this.file)},Program:{exit(path,state){if(!(0,helper_module_imports_lib.isModule)(path))return;path.scope.rename("exports"),path.scope.rename("module"),path.scope.rename("require"),path.scope.rename("__filename"),path.scope.rename("__dirname"),allowCommonJSExports||(process.env.BABEL_8_BREAKING?(0,helper_simple_access_lib.A)(path,new Set(["module","exports"])):(0,helper_simple_access_lib.A)(path,new Set(["module","exports"]),!1),path.traverse(moduleExportsVisitor,{scope:path.scope}));let moduleName=(0,helper_module_transforms_lib.getModuleName)(this.file.opts,options);moduleName&&(moduleName=lib.types.stringLiteral(moduleName));const hooks=function(file){const hooks=file.get(commonJSHooksKey);return{getWrapperPayload:(...args)=>findMap(hooks,(hook=>hook.getWrapperPayload?.(...args))),wrapReference:(...args)=>findMap(hooks,(hook=>hook.wrapReference?.(...args))),buildRequireWrapper:(...args)=>findMap(hooks,(hook=>hook.buildRequireWrapper?.(...args)))}}(this.file),{meta,headers}=(0,helper_module_transforms_lib.rewriteModuleStatementsAndPrepareHeader)(path,{exportName:"exports",constantReexports,enumerableModuleMeta,strict,strictMode,allowTopLevelThis,noInterop,importInterop,wrapReference:hooks.wrapReference,getWrapperPayload:hooks.getWrapperPayload,esNamespaceOnly:"string"==typeof state.filename&&/\.mjs$/.test(state.filename)?mjsStrictNamespace:strictNamespace,noIncompleteNsImportDetection,filename:this.file.opts.filename});for(const[source,metadata]of meta.source){const loadExpr=async?lib.types.awaitExpression(lib.types.callExpression(lib.types.identifier("jitiImport"),[lib.types.stringLiteral(source)])):lib.types.callExpression(lib.types.identifier("require"),[lib.types.stringLiteral(source)]);let header;if((0,helper_module_transforms_lib.isSideEffectImport)(metadata)){if(lazy&&"function"===metadata.wrap)throw new Error("Assertion failure");header=lib.types.expressionStatement(loadExpr)}else{const init=(0,helper_module_transforms_lib.wrapInterop)(path,loadExpr,metadata.interop)||loadExpr;if(metadata.wrap){const res=hooks.buildRequireWrapper(metadata.name,init,metadata.wrap,metadata.referenced);if(!1===res)continue;header=res}header??=lib.template.statement.ast`
var ${metadata.name} = ${init};
`}header.loc=metadata.loc,headers.push(header),headers.push(...(0,helper_module_transforms_lib.buildNamespaceInitStatements)(meta,metadata,constantReexports,hooks.wrapReference))}(0,helper_module_transforms_lib.ensureStatementsHoisted)(headers),path.unshiftContainer("body",headers),path.get("body").forEach((path=>{headers.includes(path.node)&&path.isVariableDeclaration()&&path.scope.registerDeclaration(path)}))}}}}}));function transform(opts){const _opts={babelrc:!1,configFile:!1,compact:!1,retainLines:"boolean"!=typeof opts.retainLines||opts.retainLines,filename:"",cwd:"/",...opts.babel,plugins:[[transform_module,{allowTopLevelThis:!0,noInterop:!opts.interopDefault,async:opts.async}],[importMetaPathsPlugin,{filename:opts.filename}],[importMetaEnvPlugin],[importMetaResolvePlugin],[plugin_syntax_class_properties_lib.A],[plugin_transform_export_namespace_from_lib.A]]};opts.jsx&&_opts.plugins.push([plugin_syntax_jsx_lib.default],[plugin_transform_react_jsx_lib.A,Object.assign({},opts.jsx)]),opts.ts&&(_opts.plugins.push([plugin_transform_typescript_lib.default,{allowDeclareFields:!0,isTSX:opts.jsx&&/\.[cm]?tsx$/.test(opts.filename||"")}]),_opts.plugins.unshift([babel_plugin_transform_typescript_metadata],[plugin_proposal_decorators_lib.A,{legacy:!0}]),_opts.plugins.push(babel_plugin_parameter_decorator_lib_default()),_opts.plugins.push(plugin_syntax_import_assertions_lib.A)),opts.babel&&Array.isArray(opts.babel.plugins)&&_opts.plugins?.push(...opts.babel.plugins);try{return{code:(0,lib.transformSync)(opts.source,_opts)?.code||""}}catch(error){return{error,code:"exports.__JITI_ERROR__ = "+JSON.stringify({filename:opts.filename,line:error.loc?.line||0,column:error.loc?.column||0,code:error.code?.replace("BABEL_","").replace("PARSE_ERROR","ParseError"),message:error.message?.replace("/: ","").replace(/\(.+\)\s*$/,"")})}}}})(),module.exports=__webpack_exports__.default})();
+1
View File
@@ -0,0 +1 @@
(()=>{var __webpack_modules__={"./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive",module.exports=webpackEmptyAsyncContext}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module,module.exports,__webpack_require__),module.exports}__webpack_require__.n=module=>{var getter=module&&module.__esModule?()=>module.default:()=>module;return __webpack_require__.d(getter,{a:getter}),getter},__webpack_require__.d=(exports,definition)=>{for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=(obj,prop)=>Object.prototype.hasOwnProperty.call(obj,prop);var __webpack_exports__={};(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>createJiti});const external_node_os_namespaceObject=require("node:os");var astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-Line truncated
Generated Vendored Executable
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env node
import { resolve } from "node:path";
import nodeModule from "node:module";
const script = process.argv.splice(2, 1)[0];
if (!script) {
console.error("Usage: jiti <path> [...arguments]");
process.exit(1);
}
// https://nodejs.org/api/module.html#moduleenablecompilecachecachedir
// https://github.com/nodejs/node/pull/54501
if (nodeModule.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) {
try {
nodeModule.enableCompileCache();
} catch {
// Ignore errors
}
}
const pwd = process.cwd();
const { createJiti } = await import("./jiti.cjs");
const jiti = createJiti(pwd);
const resolved = (process.argv[1] = jiti.resolve(resolve(pwd, script)));
await jiti.import(resolved).catch((error) => {
console.error(error);
process.exit(1);
});
+117
View File
@@ -0,0 +1,117 @@
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { existsSync } from "node:fs";
import { readFile } from "node:fs/promises";
import { isBuiltin } from "node:module";
import { createJiti } from "./jiti.mjs";
let jiti;
// https://nodejs.org/api/module.html#initialize
export async function initialize() {
jiti = createJiti();
}
// https://nodejs.org/api/module.html#resolvespecifier-context-nextresolve
export async function resolve(specifier, context, nextResolve) {
if (_shouldSkip(specifier)) {
return nextResolve(specifier, context);
}
const resolvedPath = jiti.esmResolve(specifier, {
parentURL: context?.parentURL,
conditions: context?.conditions,
});
return {
url: resolvedPath,
shortCircuit: true,
};
}
// https://nodejs.org/api/module.html#loadurl-context-nextload
export async function load(url, context, nextLoad) {
if (_shouldSkip(url)) {
return nextLoad(url, context);
}
const filename = fileURLToPath(url);
if (url.endsWith(".js")) {
const pkg = await _findClosestPackageJson(dirname(filename));
if (pkg && pkg.type === "module") {
return nextLoad(url, context);
}
}
const rawSource = await readFile(filename, "utf8");
if (url.endsWith(".json")) {
return {
source: `export default ${rawSource}`,
format: "module",
shortCircuit: true,
};
}
const transpiledSource = jiti.transform({
source: rawSource,
filename: filename,
ts: url.endsWith("ts"),
retainLines: true,
async: true,
jsx: jiti.options.jsx,
});
if (url.endsWith(".js") && !transpiledSource.includes("jitiImport")) {
return {
source: transpiledSource,
format: "commonjs",
shortCircuit: true,
};
}
return {
source: _wrapSource(transpiledSource, filename),
format: "module",
shortCircuit: true,
};
}
function _wrapSource(source, filename) {
const _jitiPath = new URL("jiti.mjs", import.meta.url).href;
return /*js*/ `import { createJiti as __createJiti__ } from ${JSON.stringify(_jitiPath)};async function _module(exports, require, module, __filename, __dirname, jitiImport) { ${source}\n};
// GENERATED BY JITI ESM LOADER
const filename = ${JSON.stringify(filename)};
const dirname = ${JSON.stringify(dirname(filename))};
const jiti = __createJiti__(filename);
const module = { exports: Object.create(null) };
await _module(module.exports, jiti, module, filename, dirname, jiti.import);
if (module.exports && module.exports.__JITI_ERROR__) {
const { filename, line, column, code, message } =
module.exports.__JITI_ERROR__;
const loc = [filename, line, column].join(':');
const err = new Error(code + ": " + message + " " + loc);
Error.captureStackTrace(err, _module);
throw err;
}
export default module.exports;
`;
}
function _shouldSkip(url) {
return (
!jiti ||
url.endsWith(".mjs") ||
url.endsWith(".cjs") ||
(!url.startsWith("./") && !url.startsWith("file://")) ||
isBuiltin(url)
);
}
async function _findClosestPackageJson(dir) {
if (dir === "/") return null;
const packageJsonPath = join(dir, "package.json");
if (existsSync(packageJsonPath)) {
return JSON.parse(await readFile(packageJsonPath, "utf8"));
}
return _findClosestPackageJson(dirname(dir));
}
+121
View File
@@ -0,0 +1,121 @@
/**
* @typedef {import('./types').Jiti} Jiti
* @typedef {import('./types').JitiOptions} JitiOptions
*/
const isDeno = "Deno" in globalThis;
/**
* @param {string|URL} [parentURL]
* @param {JitiOptions} [jitiOptions]
* @returns {Jiti}
*/
export function createJiti(parentURL, jitiOptions) {
parentURL = normalizeParentURL(parentURL);
/** @type {Jiti} */
function jiti() {
throw unsupportedError(
"`jiti()` is not supported in native mode, use `jiti.import()` instead.",
);
}
jiti.resolve = () => {
throw unsupportedError("`jiti.resolve()` is not supported in native mode.");
};
jiti.esmResolve = (id, opts) => {
try {
const importMeta = jitiOptions?.importMeta || import.meta;
if (isDeno) {
// Deno throws TypeError: Invalid arguments when passing parentURL
return importMeta.resolve(id);
}
const parent = normalizeParentURL(opts?.parentURL || parentURL);
return importMeta.resolve(id, parent);
} catch (error) {
if (opts?.try) {
return undefined;
} else {
throw error;
}
}
};
jiti.import = async function (id, opts) {
for (const suffix of ["", "/index"]) {
// prettier-ignore
for (const ext of ["", ".js", ".mjs", ".cjs", ".ts", ".tsx", ".mts", ".cts"]) {
try {
const resolved = this.esmResolve(id + suffix + ext, opts);
if (!resolved) {
continue;
}
let importAttrs = undefined
if (resolved.endsWith('.json')) {
importAttrs = { with: { type: 'json'}}
}
return await import(resolved, importAttrs);
} catch (error) {
if (error.code === 'ERR_MODULE_NOT_FOUND' || error.code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
continue
}
if (opts?.try) {
return undefined;
}
throw error;
}
}
}
if (!opts?.try) {
const parent = normalizeParentURL(opts?.parentURL || parentURL);
const error = new Error(
`[jiti] [ERR_MODULE_NOT_FOUND] Cannot import '${id}' from '${parent}'.`,
);
error.code = "ERR_MODULE_NOT_FOUND";
throw error;
}
};
jiti.transform = () => {
throw unsupportedError(
"`jiti.transform()` is not supported in native mode.",
);
};
jiti.evalModule = () => {
throw unsupportedError(
"`jiti.evalModule()` is not supported in native mode.",
);
};
jiti.main = undefined;
jiti.extensions = Object.create(null);
jiti.cache = Object.create(null);
return jiti;
}
export default createJiti;
/**
* @param {string} message
*/
function unsupportedError(message) {
throw new Error(
`[jiti] ${message} (import or require 'jiti' instead of 'jiti/native' for more features).`,
);
}
function normalizeParentURL(input) {
if (!input) {
return "file:///";
}
if (typeof filename !== "string" || input.startsWith("file://")) {
return input;
}
if (input.endsWith("/")) {
input += "_"; // append a dummy filename
}
return `file://${input}`;
}
+1
View File
@@ -0,0 +1 @@
// eslint-disable-next-line unicorn/no-empty-file
+4
View File
@@ -0,0 +1,4 @@
// https://nodejs.org/api/module.html#moduleregisterspecifier-parenturl-options
import { register } from "node:module";
register("./jiti-hooks.mjs", import.meta.url, {});
+23
View File
@@ -0,0 +1,23 @@
const { createRequire } = require("node:module");
const _createJiti = require("../dist/jiti.cjs");
const transform = require("../dist/babel.cjs");
function onError(err) {
throw err; /* ↓ Check stack trace ↓ */
}
const nativeImport = (id) => import(id);
function createJiti(id, opts = {}) {
if (!opts.transform) {
opts = { ...opts, transform };
}
return _createJiti(id, opts, {
onError,
nativeImport,
createRequire,
});
}
module.exports = createJiti;
module.exports.createJiti = createJiti;
+8
View File
@@ -0,0 +1,8 @@
import * as types from "./types.js";
declare const allExports: typeof types & {
/**
* @deprecated Please use `const { createJiti } = require("jiti")` or use ESM import.
*/
(...args: Parameters<typeof types.createJiti>): types.Jiti;
};
export = allExports;
+8
View File
@@ -0,0 +1,8 @@
import { createJiti } from "./types.js";
export * from "./types.js";
/**
* @deprecated Please use `import { createJiti } from "jiti"`
*/
export default createJiti;
+22
View File
@@ -0,0 +1,22 @@
import { createRequire } from "node:module";
import _createJiti from "../dist/jiti.cjs";
import transform from "../dist/babel.cjs";
function onError(err) {
throw err; /* ↓ Check stack trace ↓ */
}
const nativeImport = (id) => import(id);
export function createJiti(id, opts = {}) {
if (!opts.transform) {
opts = { ...opts, transform };
}
return _createJiti(id, opts, {
onError,
nativeImport,
createRequire,
});
}
export default createJiti;
+260
View File
@@ -0,0 +1,260 @@
export declare function createJiti(id: string, userOptions?: JitiOptions): Jiti;
/**
* Jiti instance
*
* Calling jiti() is similar to CommonJS require() but adds extra features such as Typescript and ESM compatibility.
*
* **Note:**It is recommended to use `await jiti.import` instead
*/
export interface Jiti extends NodeRequire {
/**
* Resolved options
*/
options: JitiOptions;
/**
* ESM import a module with additional Typescript and ESM compatibility.
*
* If you need the default export of module, you can use `jiti.import(id, { default: true })` as shortcut to `mod?.default ?? mod`.
*/
import<T = unknown>(
id: string,
opts?: JitiResolveOptions & { default?: true },
): Promise<T>;
/**
* Resolve with ESM import conditions.
*/
esmResolve(id: string, parentURL?: string): string;
esmResolve<T extends JitiResolveOptions = JitiResolveOptions>(
id: string,
opts?: T,
): T["try"] extends true ? string | undefined : string;
/**
* Transform source code
*/
transform: (opts: TransformOptions) => string;
/**
* Evaluate transformed code as a module
*/
evalModule: (source: string, options?: EvalModuleOptions) => unknown;
}
/**
* Jiti instance options
*/
export interface JitiOptions {
/**
* Filesystem source cache (enabled by default)
*
* An string can be passed to set the custom cache directory.
*
* By default (when is `true`), jiti uses `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/jiti`.
*
* This option can also be disabled using `JITI_FS_CACHE=false` environment variable.
*
* **Note:** It is recommended to keep this option enabled for better performance.
*/
fsCache?: boolean | string;
/** @deprecated Use `fsCache` option. */
cache?: boolean | string;
/**
* Runtime module cache (enabled by default)
*
* Disabling allows editing code and importing same module multiple times.
*
* When enabled, jiti integrates with Node.js native CommonJS cache store.
*
* This option can also be disabled using `JITI_MODULE_CACHE=false` environment variable.
*/
moduleCache?: boolean;
/** @deprecated Use `moduleCache` option. */
requireCache?: boolean;
/**
* Custom transform function
*/
transform?: (opts: TransformOptions) => TransformResult;
/**
* Enable verbose debugging (disabled by default).
*
* Can also be enabled using `JITI_DEBUG=1` environment variable.
*/
debug?: boolean;
/**
* Enable sourcemaps (enabled by default)
*
* Can also be disabled using `JITI_SOURCE_MAPS=0` environment variable.
*/
sourceMaps?: boolean;
/**
* Jiti combines module exports with the `default` export using an internal Proxy to improve compatibility with mixed CJS/ESM usage. You can check the current implementation [here](https://github.com/unjs/jiti/blob/main/src/utils.ts#L105).
*
* Can be disabled using `JITI_INTEROP_DEFAULT=0` environment variable.
*/
interopDefault?: boolean;
/**
* Jiti hard source cache version (internal)
*/
cacheVersion?: string;
/**
* Supported extensions to resolve.
*
* Default `[".js", ".mjs", ".cjs", ".ts", ".mts", ".cts", ".json"]`
*/
extensions?: string[];
/**
* Transform options
*/
transformOptions?: Omit<TransformOptions, "source">;
/**
* Resolve aliases
*
* You can use `JITI_ALIAS` environment variable to set aliases as a JSON string.
*/
alias?: Record<string, string>;
/**
* List of modules (within `node_modules`) to always use native require/import for them.
*
* You can use `JITI_NATIVE_MODULES` environment variable to set native modules as a JSON string.
*
*/
nativeModules?: string[];
/**
* List of modules (within `node_modules`) to transform them regardless of syntax.
*
* You can use `JITI_TRANSFORM_MODULES` environment variable to set transform modules as a JSON string.
*/
transformModules?: string[];
/**
* Parent module's import.meta context to use for ESM resolution.
*
* (Only used for `jiti/native` import)
*/
importMeta?: ImportMeta;
/**
* Try to use native require and import without jiti transformations first.
*
* Enabled if Bun is detected.
*/
tryNative?: boolean;
/**
* Enable JSX support Enable JSX support using [`@babel/plugin-transform-react-jsx`](https://babeljs.io/docs/babel-plugin-transform-react-jsx).
*
* @default false
*
* You can also use `JITI_JSX=1` environment variable to enable JSX support.
*/
jsx?: boolean | JSXOptions;
}
interface NodeRequire {
/**
* Module cache
*/
cache: ModuleCache;
/** @deprecated Prefer `await jiti.import()` for better compatibility. */
(id: string): any;
/** @deprecated Prefer `jiti.esmResolve` for better compatibility. */
resolve: {
/** @deprecated */
(id: string, options?: { paths?: string[] | undefined }): string;
/** @deprecated */
paths(request: string): string[] | null;
};
/** @deprecated CommonJS API */
extensions: Record<
".js" | ".json" | ".node",
(m: NodeModule, filename: string) => any | undefined
>;
/** @deprecated CommonJS API */
main: NodeModule | undefined;
}
export interface NodeModule {
/**
* `true` if the module is running during the Node.js preload
*/
isPreloading: boolean;
exports: any;
require: NodeRequire;
id: string;
filename: string;
loaded: boolean;
/** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
parent: NodeModule | null | undefined;
children: NodeModule[];
/**
* @since v11.14.0
*
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
*/
path: string;
paths: string[];
}
export type ModuleCache = Record<string, NodeModule>;
export type EvalModuleOptions = Partial<{
id: string;
filename: string;
ext: string;
cache: ModuleCache;
async: boolean;
forceTranspile: boolean;
}>;
export interface TransformOptions {
source: string;
filename?: string;
ts?: boolean;
retainLines?: boolean;
interopDefault?: boolean;
async?: boolean;
jsx?: boolean | JSXOptions;
babel?: Record<string, any>;
}
export interface TransformResult {
code: string;
error?: any;
}
export interface JitiResolveOptions {
conditions?: string[];
parentURL?: string | URL;
try?: boolean;
}
/** Reference: https://babeljs.io/docs/babel-plugin-transform-react-jsx#options */
export interface JSXOptions {
throwIfNamespace?: boolean;
runtime?: "classic" | "automatic";
importSource?: string;
pragma?: string;
pragmaFrag?: string;
useBuiltIns?: boolean;
useSpread?: boolean;
}
+134
View File
@@ -0,0 +1,134 @@
{
"name": "jiti",
"version": "2.4.2",
"description": "Runtime typescript and ESM support for Node.js",
"repository": "unjs/jiti",
"license": "MIT",
"type": "module",
"exports": {
".": {
"import": {
"types": "./lib/jiti.d.mts",
"default": "./lib/jiti.mjs"
},
"require": {
"types": "./lib/jiti.d.cts",
"default": "./lib/jiti.cjs"
}
},
"./register": {
"types": "./lib/jiti-register.d.mts",
"import": "./lib/jiti-register.mjs"
},
"./native": {
"types": "./lib/jiti.d.mts",
"import": "./lib/jiti-native.mjs"
},
"./package.json": "./package.json"
},
"main": "./lib/jiti.cjs",
"module": "./lib/jiti.mjs",
"types": "./lib/jiti.d.cts",
"typesVersions": {
"*": {
"register": [
"./lib/jiti-register.d.mts"
],
"native": [
"./lib/jiti.d.mts"
]
}
},
"bin": {
"jiti": "./lib/jiti-cli.mjs"
},
"files": [
"lib",
"dist",
"register.cjs"
],
"scripts": {
"build": "pnpm clean && NODE_ENV=production pnpm webpack",
"clean": "rm -rf dist",
"dev": "pnpm clean && pnpm webpack --watch",
"jiti": "JITI_DEBUG=1 JITI_JSX=1 lib/jiti-cli.mjs",
"lint": "eslint . && prettier -c src lib test stubs",
"lint:fix": "eslint --fix . && prettier -w src lib test stubs",
"prepack": "pnpm build",
"release": "pnpm build && pnpm test && changelogen --release --push --publish",
"test": "pnpm lint && pnpm test:types && vitest run --coverage && pnpm test:node-register && pnpm test:bun && pnpm test:native",
"test:bun": "bun --bun test test/bun",
"test:native": "pnpm test:native:bun && pnpm test:native:node && pnpm test:native:deno",
"test:native:bun": "bun --bun test test/native/bun.test.ts",
"test:native:deno": "deno test -A --no-check test/native/deno.test.ts",
"test:native:node": "node --test --experimental-strip-types test/native/node.test.ts",
"test:node-register": "JITI_JSX=1 node --test test/node-register.test.mjs",
"test:types": "tsc --noEmit"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/helper-module-imports": "^7.25.9",
"@babel/helper-module-transforms": "^7.26.0",
"@babel/helper-plugin-utils": "^7.25.9",
"@babel/helper-simple-access": "^7.25.9",
"@babel/plugin-proposal-decorators": "^7.25.9",
"@babel/plugin-syntax-class-properties": "^7.12.13",
"@babel/plugin-syntax-import-assertions": "^7.26.0",
"@babel/plugin-syntax-jsx": "^7.25.9",
"@babel/plugin-transform-export-namespace-from": "^7.25.9",
"@babel/plugin-transform-react-jsx": "^7.25.9",
"@babel/plugin-transform-typescript": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@babel/template": "^7.25.9",
"@babel/traverse": "^7.26.4",
"@babel/types": "^7.26.3",
"@types/babel__core": "^7.20.5",
"@types/babel__helper-module-imports": "^7.18.3",
"@types/babel__helper-plugin-utils": "^7.10.3",
"@types/babel__template": "^7.4.4",
"@types/babel__traverse": "^7.20.6",
"@types/node": "^22.10.2",
"@vitest/coverage-v8": "^2.1.8",
"acorn": "^8.14.0",
"babel-plugin-parameter-decorator": "^1.0.16",
"changelogen": "^0.5.7",
"config": "^3.3.12",
"consola": "^3.2.3",
"defu": "^6.1.4",
"destr": "^2.0.3",
"escape-string-regexp": "^5.0.0",
"eslint": "^9.17.0",
"eslint-config-unjs": "^0.4.2",
"estree-walker": "^3.0.3",
"etag": "^1.8.1",
"fast-glob": "^3.3.2",
"is-installed-globally": "^1.0.0",
"mime": "^4.0.4",
"mlly": "^1.7.3",
"moment-timezone": "^0.5.46",
"nano-jsx": "^0.1.0",
"pathe": "^1.1.2",
"pkg-types": "^1.2.1",
"preact": "^10.25.2",
"preact-render-to-string": "^6.5.12",
"prettier": "^3.4.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"reflect-metadata": "^0.2.2",
"solid-js": "^1.9.3",
"std-env": "^3.8.0",
"terser-webpack-plugin": "^5.3.11",
"tinyexec": "^0.3.1",
"ts-loader": "^9.5.1",
"typescript": "^5.7.2",
"vitest": "^2.1.8",
"vue": "^3.5.13",
"webpack": "^5.97.1",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-license-plugin": "^4.5.0",
"yoctocolors": "^2.1.1",
"zod": "^3.24.1"
},
"packageManager": "pnpm@9.15.0"
}