@visulima/packem 1.17.2 → 1.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cli.mjs +48 -48
- package/dist/packem.cjs +2 -2
- package/dist/packem.mjs +22 -22
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var jn=Object.defineProperty;var g=(e,t)=>jn(e,"name",{value:t,configurable:!0});import $n from"@visulima/cerebro";import{SimpleReporter as En}from"@visulima/pail/reporter";import Ie,{cwd as
|
|
2
|
+
var jn=Object.defineProperty;var g=(e,t)=>jn(e,"name",{value:t,configurable:!0});import $n from"@visulima/cerebro";import{SimpleReporter as En}from"@visulima/pail/reporter";import Ie,{cwd as xi,env as Sn,versions as On,exit as Pn}from"node:process";import{installPackage as dt}from"@antfu/install-pkg";import{spinner as ut,select as Z,multiselect as yi,confirm as V,intro as Dn,log as Nt,cancel as Cn,outro as Nn}from"@clack/prompts";import{isAccessible as Ge,readFile as De,writeFile as bi,isAccessibleSync as L,readFileSync as He,writeFileSync as ce,readJson as wi,writeJsonSync as wt,ensureDir as Mt,walk as Mn,collectSync as _n,emptyDir as Tn,readJsonSync as In,ensureDirSync as zn}from"@visulima/fs";import{join as $,resolve as P,normalize as G,relative as I,dirname as _,basename as H,isAbsolute as Ce,parse as ot,toNamespacedPath as Le,extname as Ne}from"@visulima/path";import ee from"magic-string";import{cyan as D,bold as K,gray as ie,green as An,yellow as Rn,grey as Fn}from"@visulima/colorize";import{findCacheDirSync as Ln}from"@visulima/find-cache-dir";import{formatBytes as R,parseBytes as _t,duration as Tt}from"@visulima/humanizer";import{hasPackageJsonAnyDependency as ki}from"@visulima/package";import{readTsConfig as Bn,findTsConfig as Jn}from"@visulima/tsconfig";import qn from"browserslist";import{defu as Wn}from"defu";import{createHooks as Un}from"hookable";import{createJiti as ji}from"jiti";import{rollup as $i,watch as It,VERSION as Vn}from"rollup";import{exec as Kn}from"tinyexec";import{stat as kt,chmod as Gn,readFile as Hn,readdir as Yn,rm as Xn}from"node:fs/promises";import Ei from"@rollup/plugin-alias";import Qn from"@rollup/plugin-commonjs";import Zn from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as Si}from"@rollup/plugin-node-resolve";import Oi from"@rollup/plugin-replace";import{wasm as eo}from"@rollup/plugin-wasm";import to from"rollup-plugin-polyfill-node";import{visualizer as io}from"rollup-plugin-visualizer";import{minVersion as Pi,valid as no,coerce as oo}from"semver";import Be from"node:assert/strict";import{extractAssignedNames as ao,createFilter as Y}from"@rollup/pluginutils";import so from"glob-parent";import{glob as ro,isDynamicPattern as zt,globSync as lo}from"tinyglobby";import{isRelative as jt,resolveAlias as po}from"@visulima/path/utils";import{SourceMapConsumer as co,SourceMapGenerator as uo}from"source-map-js";import{interopDefault as mo,loadModule as fo,findStaticImports as Di,fileURLToPath as go,resolveModuleExportNames as ho,resolvePath as At}from"mlly";import{fileURLToPath as Ci}from"node:url";import{ResolverFactory as Ni}from"oxc-resolver";import{parseAsync as vo}from"oxc-parser";import xo from"@rollup/plugin-json";import yo from"rollup-plugin-license";import{findPackageJson as bo,parsePackageJson as Mi}from"@visulima/package/package-json";import wo,{createHash as ko}from"node:crypto";import{readdirSync as jo,createReadStream as $t,createWriteStream as $o,existsSync as Eo}from"node:fs";import Rt,{isBuiltin as at}from"node:module";import{loadSourceMap as So}from"@visulima/source-map";import{parse as Oo}from"@babel/parser";import{createBrotliCompress as Po,constants as Do,createGzip as Co}from"node:zlib";import No from"child_process";import{NotFoundError as Mo}from"@visulima/fs/error";import{distance as _o}from"fastest-levenshtein";import To from"picomatch";import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
|
|
3
3
|
import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
|
|
4
4
|
import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
5
5
|
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
7
7
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
8
|
-
const
|
|
8
|
+
const Io="@visulima/packem",zo="1.17.2";var Ao=Object.defineProperty,Ro=g((e,t)=>Ao(e,"name",{value:t,configurable:!0}),"t$f");const _i=Ro(async(e,t="")=>{let i=t;if(!i){const n=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const o of n)if(await Ge($(e,o))){i="./"+o;break}}if(!/\.(?:js|mjs|cjs|ts|cts|mts)$/.test(i))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return i},"findPackemFile"),Ti={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","icss-utils"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"]};var Fo=Object.defineProperty,Ft=g((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"g$9");const Lo=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults"],Bo=Ft(e=>{e.addCommand({argument:{description:"Add a packem feature to your project",name:"feature",required:!0},description:"Add a optional packem feature to your project",execute:Ft(async({argument:t,logger:i,options:n})=>{const o=ut(),a=P(xi(),n.dir??".");let s;try{s=await _i(a,n.config)}catch{i.error("Could not find a packem config file, please run `packem init` first.");return}const r=await De(s,{buffer:!1});let p="cjs";r.includes("import")&&(p="esm");const l=new ee(r),c=" transformer,";let u=" transformer";if(r.includes(" transformer,")&&(u=" transformer,"),t.includes("typedoc")){if(r.includes("typedoc: typedocBuilder")||r.includes("@visulima/packem/builder/typedoc")){i.warn("Typedoc has already been added to the packem config.");return}p==="cjs"?l.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
|
|
9
9
|
`):l.prepend(`import typedocBuilder from "@visulima/packem/builder/typedoc";
|
|
10
10
|
`),r.includes("builder: {")?l.replace("builder: {",`builder: {
|
|
11
11
|
typedoc: typedocBuilder,
|
|
12
12
|
`):l.replace(u,c+`
|
|
13
13
|
builder: {
|
|
14
14
|
typedoc: typedocBuilder,
|
|
15
|
-
},`),i.info("Adding typedoc dependencies..."),o.start("Installing packages"),await dt(
|
|
16
|
-
Typedoc added!`)}if(t.includes("css")){if(r.includes("css: {")||r.includes("@visulima/packem/css")){i.warn("Css loaders have already been added to the packem config.");return}const d=[],m=await Z({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});d.push(m);let v=await
|
|
15
|
+
},`),i.info("Adding typedoc dependencies..."),o.start("Installing packages"),await dt(Lo,{cwd:a,dev:!0,silent:!0}),o.stop("Installed packages"),i.success(`
|
|
16
|
+
Typedoc added!`)}if(t.includes("css")){if(r.includes("css: {")||r.includes("@visulima/packem/css")){i.warn("Css loaders have already been added to the packem config.");return}const d=[],m=await Z({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});d.push(m);let v=await yi({message:"Pick extra loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1});if(v.includes("sass")){const b=await Z({message:"Pick a sass loader",options:[{hint:"recommended",label:"Sass embedded",value:"sass-embedded"},{label:"Sass",value:"sass"},{hint:"legacy",label:"Node Sass",value:"node-sass"}]});b!=="sass"&&(v=v.filter(y=>y!=="sass"),v.push(b))}d.push(...v);const h=[];for(const b of d)h.push(...Ti[b]);d.push("sourceMap");for(let b of d)(b==="sass-embedded"||b==="node-sass")&&(b="sass"),p==="cjs"?l.prepend(`const ${b}Loader = require("@visulima/packem/css/loader/${b.toLowerCase()}");
|
|
17
17
|
`):l.prepend(`import ${b}Loader from "@visulima/packem/css/loader/${b.toLowerCase()}";
|
|
18
18
|
`);const x=await V({initialValue:!1,message:"Do you want to minify your css?"});let f;x&&(f=await Z({message:"Pick a css minifier",options:[{label:"CSSNano",value:"cssnano"},{label:"Lightning CSS",value:"lightningcss"}]}),d.includes("lightningcss")||h.push(f),p==="cjs"?l.prepend(`const ${f}Minifier = require("@visulima/packem/css/minifier/${f.toLowerCase()}");
|
|
19
19
|
`):l.prepend(`import ${f}Minifier from "@visulima/packem/css/minifier/${f.toLowerCase()}";
|
|
@@ -29,17 +29,17 @@ Typedoc added!`)}if(t.includes("css")){if(r.includes("css: {")||r.includes("@vis
|
|
|
29
29
|
loaders: [${k}],
|
|
30
30
|
},
|
|
31
31
|
},`),o.start("Installing packages"),await dt(h,{cwd:a,dev:!0,silent:!0}),o.stop("Installed packages"),i.success(`
|
|
32
|
-
CSS loaders added!`)}await
|
|
32
|
+
CSS loaders added!`)}await bi(s,l.toString(),{overwrite:!0})},"execute"),name:"add",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{description:"Use a custom config file",name:"config",type:String}]})},"createAddCommand"),Ye=[".mjs",".js",".json",".node",".cjs",".ts",".cts",".mts",".tsx",".ctsx",".mtsx",".jsx"],oe="production",Je="development",Et=new Set(["react-server","react-native","edge-light"]),qe=new Set([Je,oe,...Et]),ye=/node_modules/,se=/(?:\.d\.[mc]?tsx?|\.\w+)$/,Jo="packem_chunks",qo="packem_shared",be=/\.(?:m|c)?(?:j|t)sx?$/;var Wo=Object.defineProperty,Uo=g((e,t)=>Wo(e,"name",{value:t,configurable:!0}),"a$v");const mt=Uo(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var Vo=Object.defineProperty,Ii=g((e,t)=>Vo(e,"name",{value:t,configurable:!0}),"s$m");const Ko=Ii((e,t,i)=>{const n=i??new Map;return(...o)=>{const a=t?typeof t=="function"?t(...o):t:JSON.stringify({args:o}),s=n.get(a);if(s!==void 0)return s;const r=e(...o);return n.set(a,r),r}},"memoize"),Go=Ii(e=>{const t=new Map;return i=>Ko(e,i,t)},"memoizeByKey");var Ho=Object.defineProperty,Me=g((e,t)=>Ho(e,"name",{value:t,configurable:!0}),"r$i");const Yo=Me(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;Be(t,"Expected class/function to have a name"),yield t.name;break}case"VariableDeclaration":{for(const t of e.declaration.declarations)for(const i of ao(t.id))yield i;break}}},"exportName"),Xo=Me(function*(e){if(e.declaration)for(const t of Yo(e))yield{exportedName:t,from:"self",type:"named"};else if(e.source)yield{bindings:e.specifiers.map(t=>({exportedName:t.exported.name,importedName:t.local.name})),from:"other",source:e.source.value,type:"named"};else for(const t of e.specifiers)yield{exportedName:t.exported.name,from:"self",type:"named"}},"parseExportNamed"),Qo=Me(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Zo=Me(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),ea=Me(function*(e,t){Be(t.code!=null,`Module ${t.id} doesn't have associated code`);const i=e.parse(t.code);for(const n of i.body)switch(n.type){case"ExportAllDeclaration":{yield*Qo(n);break}case"ExportDefaultDeclaration":{yield*Zo();break}case"ExportNamedDeclaration":{yield*Xo(n);break}}},"parseExports");var ta=Object.defineProperty,_e=g((e,t)=>ta(e,"name",{value:t,configurable:!0}),"n$f");const zi=_e(async function(e,t,i){const n=await e.resolve(t,i.id);if(Be(n,`Rollup can't resolve ${t} from ${i.id}`),n.external)return null;const o=await e.load(n);return Be(o,`Rollup doesn't have a module for id ${n.id}`),o},"getImportedModule"),ia=_e(async function*(e,t,i){const n=await zi(e,t.source,i);n&&(yield*St(e,n))},"gatherBarrelReExports"),na=_e(async function*(e,t,i){const n=await zi(e,t.source,i);if(!n)return;const o=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of St(e,n)){const s=o.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),oa=_e(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),St=_e(async function*(e,t){for(const i of ea(e,t))i.from==="self"?yield*oa(t,i):i.type==="barrel"?yield*ia(e,i,t):yield*na(e,i,t)},"gatherExports");var aa=Object.defineProperty,sa=g((e,t)=>aa(e,"name",{value:t,configurable:!0}),"r$h");const ra=sa(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of St(this,e))t.id!==e.id&&this.emitFile({id:t.id,name:t.exportedName,preserveSignature:"exports-only",type:"chunk"})},order:"post"},name:"packem:chunk-splitter"}),"chunkSplitter");var la=Object.defineProperty,pa=g((e,t)=>la(e,"name",{value:t,configurable:!0}),"r$g");const ca=pa((e,t)=>{const i=e,n=[];let o;for(;(o=i.exec(t))!==null;)o.index===i.lastIndex&&i.lastIndex++,o.forEach(a=>{n.push(a)});return n.filter(Boolean)},"getRegexMatches");var da=Object.defineProperty,ua=g((e,t)=>da(e,"name",{value:t,configurable:!0}),"a$u");const Ai=ua(e=>{const t=ca(/export\s(\{\s(.*)\s\}|default\s.*);/g,e);if(t.length===0)return null;const i=t.at(-1).split(", ");let n="";for(const o of i)if(!o.includes("type")&&(o.includes("default ")&&(n=o.split("default ")[1]),o.includes("as"))){const[a,s]=o.split(" as ");s==="default"&&(n=a)}if(n!==""){const o=new ee(e);return o.replace(new RegExp(`(,s)?${n} as default(,)?`),""),o.replace(new RegExp(`export default ${n};
|
|
33
33
|
?`),""),o.append(`
|
|
34
34
|
|
|
35
|
-
export = `+n+";"),{code:o.toString().replace(/export\s\{\s\s\};/,""),map:o.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var
|
|
36
|
-
module.exports.default = `+s[2]+";");let p=r.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+o.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:r.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(o.fileName)?i!=="commonjs"&&o.fileName.endsWith(".d.mts")?null:Ai(n):null},"renderChunk")}),"cjsInteropPlugin");var ga=Object.defineProperty,ha=g((e,t)=>ga(e,"name",{value:t,configurable:!0}),"f$h");const va=ha((e,t)=>{const i=new Map,n={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:o}=n;return Array.isArray(o)?o=o.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof o=="string"&&(o=[{src:o}]),{async buildStart(){const a=await Promise.all(o.flatMap(s=>Array.isArray(s.src)?s.src.map(r=>({...s,src:r})):s).map(async s=>await lo(mt(s.src),{ignore:mt(s.exclude).filter(Boolean)}).then(r=>({dest:s.dest??"",parent:ro(s.src),src:r}))));for(const s of a)for(const r of s.src){let p;i.has(r)?p=i.get(r):(p={copied:[],dest:[],timestamp:0},i.set(r,p));const l=n.flatten?G(s.dest):$(s.dest,I(s.parent,_(r)));p.dest.includes(l)||p.dest.push(l),this.addWatchFile(r)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,r])=>{let p;try{const l=await wt(s);if(!l.isFile())return;const c=l.mtime.getTime();c>r.timestamp&&(r.timestamp=c,r.copied=[]),p=await De(s,{buffer:!0})}catch(l){t.error({context:[l],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const l of r.dest){if(n.copyOnce&&r.copied.includes(l))continue;const c=H(s),u=$(l,c);try{this.emitFile({[n.exactFileNames?"fileName":"name"]:u,source:p,type:"asset"}),t.debug({message:`copied ${s} → ${u}`,prefix:"plugin:copy"}),r.copied.push(l)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${u}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");function Fi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Fi,"getDefaultExportFromCjs");var st={exports:{}},Lt;function xa(){return Lt||(Lt=1,function(e){var t=Object.defineProperty,i=g((c,u)=>t(c,"name",{value:u,configurable:!0}),"c"),n=Object.prototype.hasOwnProperty,o="~";function a(){}g(a,"Events"),i(a,"Events"),Object.create&&(a.prototype=Object.create(null),new a().__proto__||(o=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}g(s,"EE"),i(s,"EE");function r(c,u,d,m,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new s(d,m||c,v),x=o?o+u:u;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],h]:c._events[x].push(h):(c._events[x]=h,c._eventsCount++),c}g(r,"addListener"),i(r,"addListener");function p(c,u){--c._eventsCount===0?c._events=new a:delete c._events[u]}g(p,"clearEvent"),i(p,"clearEvent");function l(){this._events=new a,this._eventsCount=0}g(l,"EventEmitter"),i(l,"EventEmitter"),l.prototype.eventNames=i(function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)n.call(u,d)&&c.push(o?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},"eventNames"),l.prototype.listeners=i(function(c){var u=o?o+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var m=0,v=d.length,h=new Array(v);m<v;m++)h[m]=d[m].fn;return h},"listeners"),l.prototype.listenerCount=i(function(c){var u=o?o+c:c,d=this._events[u];return d?d.fn?1:d.length:0},"listenerCount"),l.prototype.emit=i(function(c,u,d,m,v,h){var x=o?o+c:c;if(!this._events[x])return!1;var f=this._events[x],k=arguments.length,b,y;if(f.fn){switch(f.once&&this.removeListener(c,f.fn,void 0,!0),k){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,u),!0;case 3:return f.fn.call(f.context,u,d),!0;case 4:return f.fn.call(f.context,u,d,m),!0;case 5:return f.fn.call(f.context,u,d,m,v),!0;case 6:return f.fn.call(f.context,u,d,m,v,h),!0}for(y=1,b=new Array(k-1);y<k;y++)b[y-1]=arguments[y];f.fn.apply(f.context,b)}else{var j=f.length,w;for(y=0;y<j;y++)switch(f[y].once&&this.removeListener(c,f[y].fn,void 0,!0),k){case 1:f[y].fn.call(f[y].context);break;case 2:f[y].fn.call(f[y].context,u);break;case 3:f[y].fn.call(f[y].context,u,d);break;case 4:f[y].fn.call(f[y].context,u,d,m);break;default:if(!b)for(w=1,b=new Array(k-1);w<k;w++)b[w-1]=arguments[w];f[y].fn.apply(f[y].context,b)}}return!0},"emit"),l.prototype.on=i(function(c,u,d){return r(this,c,u,d,!1)},"on"),l.prototype.once=i(function(c,u,d){return r(this,c,u,d,!0)},"once"),l.prototype.removeListener=i(function(c,u,d,m){var v=o?o+c:c;if(!this._events[v])return this;if(!u)return p(this,v),this;var h=this._events[v];if(h.fn)h.fn===u&&(!m||h.once)&&(!d||h.context===d)&&p(this,v);else{for(var x=0,f=[],k=h.length;x<k;x++)(h[x].fn!==u||m&&!h[x].once||d&&h[x].context!==d)&&f.push(h[x]);f.length?this._events[v]=f.length===1?f[0]:f:p(this,v)}return this},"removeListener"),l.prototype.removeAllListeners=i(function(c){var u;return c?(u=o?o+c:c,this._events[u]&&p(this,u)):(this._events=new a,this._eventsCount=0),this},"removeAllListeners"),l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=o,l.EventEmitter=l,e.exports=l}(st)),st.exports}g(xa,"requireEventemitter3");var ya=xa();const ba=Fi(ya);var wa=Object.defineProperty,he=g((e,t)=>wa(e,"name",{value:t,configurable:!0}),"o$8");class Li extends Error{static{g(this,"TimeoutError")}static{he(this,"TimeoutError")}constructor(t){super(t),this.name="TimeoutError"}}class ka extends Error{static{g(this,"AbortError")}static{he(this,"AbortError")}constructor(t){super(),this.name="AbortError",this.message=t}}const Jt=he(e=>globalThis.DOMException===void 0?new ka(e):new DOMException(e),"getDOMException"),Bt=he(e=>{const t=e.reason===void 0?Jt("This operation was aborted."):e.reason;return t instanceof Error?t:Jt(t)},"getAbortedReason");function Ji(e,t){const{milliseconds:i,fallback:n,message:o,customTimers:a={setTimeout,clearTimeout}}=t;let s;const r=new Promise((p,l)=>{if(typeof i!="number"||Math.sign(i)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${i}\``);if(t.signal){const{signal:u}=t;u.aborted&&l(Bt(u));const d=he(()=>{l(Bt(u))},"abortHandler");u.addEventListener("abort",d,{once:!0}),e.finally(()=>{u.removeEventListener("abort",d)})}if(i===Number.POSITIVE_INFINITY){e.then(p,l);return}const c=new Li;s=a.setTimeout.call(void 0,()=>{if(n){try{p(n())}catch(u){l(u)}return}typeof e.cancel=="function"&&e.cancel(),o===!1?p():o instanceof Error?l(o):(c.message=o??`Promise timed out after ${i} milliseconds`,l(c))},i),(async()=>{try{p(await e)}catch(u){l(u)}})()}).finally(()=>{r.clear()});return r.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},r}g(Ji,"T$1");he(Ji,"pTimeout");var ja=Object.defineProperty,$a=g((e,t)=>ja(e,"name",{value:t,configurable:!0}),"i$h");function Bi(e,t,i){let n=0,o=e.length;for(;o>0;){const a=Math.trunc(o/2);let s=n+a;i(e[s],t)<=0?(n=++s,o-=a+1):o=a}return n}g(Bi,"r$f");$a(Bi,"lowerBound");var Ea=Object.defineProperty,Sa=g((e,t)=>Ea(e,"name",{value:t,configurable:!0}),"s$j");let Oa=class{static{g(this,"y")}static{Sa(this,"PriorityQueue")}#e=[];enqueue(t,i){i={priority:0,...i};const n={priority:i.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=i.priority){this.#e.push(n);return}const o=Bi(this.#e,n,(a,s)=>s.priority-a.priority);this.#e.splice(o,0,n)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(i=>i.priority===t.priority).map(i=>i.run)}get size(){return this.#e.length}};var Pa=Object.defineProperty,qt=g((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"n$c");let Da=class extends ba{static{g(this,"d")}static{qt(this,"PQueue")}#e;#i;#a=0;#r;#s;#f=0;#n;#p;#t;#g;#o=0;#c;#l;#h;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Oa,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#i=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#g=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#h=t.throwOnTimeout===!0,this.#l=t.autoStart===!1}get#y(){return this.#i||this.#a<this.#r}get#b(){return this.#o<this.#c}#w(){this.#o--,this.#d(),this.emit("next")}#k(){this.#x(),this.#v(),this.#p=void 0}get#j(){const t=Date.now();if(this.#n===void 0){const i=this.#f-t;if(i<0)this.#a=this.#e?this.#o:0;else return this.#p===void 0&&(this.#p=setTimeout(()=>{this.#k()},i)),!0}return!1}#d(){if(this.#t.size===0)return this.#n&&clearInterval(this.#n),this.#n=void 0,this.emit("empty"),this.#o===0&&this.emit("idle"),!1;if(!this.#l){const t=!this.#j;if(this.#y&&this.#b){const i=this.#t.dequeue();return i?(this.emit("active"),i(),t&&this.#v(),!0):!1}}return!1}#v(){this.#i||this.#n!==void 0||(this.#n=setInterval(()=>{this.#x()},this.#s),this.#f=Date.now()+this.#s)}#x(){this.#a===0&&this.#o===0&&this.#n&&(clearInterval(this.#n),this.#n=void 0),this.#a=this.#e?this.#o:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#u()}async#$(t){return new Promise((i,n)=>{t.addEventListener("abort",()=>{n(t.reason)},{once:!0})})}async add(t,i={}){return i={timeout:this.timeout,throwOnTimeout:this.#h,...i},new Promise((n,o)=>{this.#t.enqueue(async()=>{this.#o++,this.#a++;try{i.signal?.throwIfAborted();let a=t({signal:i.signal});i.timeout&&(a=Ji(Promise.resolve(a),{milliseconds:i.timeout})),i.signal&&(a=Promise.race([a,this.#$(i.signal)]));const s=await a;n(s),this.emit("completed",s)}catch(a){if(a instanceof Li&&!i.throwOnTimeout){n();return}o(a),this.emit("error",a)}finally{this.#w()}},i),this.emit("add"),this.#d()})}async addAll(t,i){return Promise.all(t.map(async n=>this.add(n,i)))}start(){return this.#l?(this.#l=!1,this.#u(),this):this}pause(){this.#l=!0}clear(){this.#t=new this.#g}async onEmpty(){this.#t.size!==0&&await this.#m("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#m("next",()=>this.#t.size<t)}async onIdle(){this.#o===0&&this.#t.size===0||await this.#m("idle")}async#m(t,i){return new Promise(n=>{const o=qt(()=>{i&&!i()||(this.off(t,o),n())},"listener");this.on(t,o)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#o}get isPaused(){return this.#l}};var Ca=Object.defineProperty,Na=g((e,t)=>Ca(e,"name",{value:t,configurable:!0}),"r$e");const Wt=Na((e,t)=>{if(!t)return!1;if(typeof t=="function")return t(e);if(typeof t.test=="function")return t.test(e);throw new Error("Invalid condition type")},"matchFile");var Ma=Object.defineProperty,_a=g((e,t)=>Ma(e,"name",{value:t,configurable:!0}),"a$t");const Ta=4,Ia=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):Ta;let za=class{static{g(this,"f")}static{_a(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:i,logger:n,options:o}){this.test=a=>t.some(s=>a.toLowerCase().endsWith(s)),i.length>0&&this.add(...i),this.options=o,this.logger=n}add(...t){for(const i of t)this.loaders.has(i.name)||this.loaders.set(i.name,i)}isSupported(t){if(this.test(t))return!0;for(const[,i]of this.loaders)if(Wt(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new Da({concurrency:Ia-1}));for await(const[n,o]of this.loaders){const a={...i,options:this.options[n]??{}};if(o.alwaysProcess||Wt(a.id,o.test)){this.logger.debug(`Processing ${n} loader for ${a.id}`);const s=await this.workQueue.add(o.process.bind(a,t));s&&(t=s)}}return t}};const Aa=/data:[^\n\r;]+(?:;charset=[^\n\r;]+)?;base64,([\d+/A-Za-z]+={0,2})/;var Ra=Object.defineProperty,Xe=g((e,t)=>Ra(e,"name",{value:t,configurable:!0}),"i$g");const qi=/(?:\n|\r\n)?\/\*[#*@]+\s*sourceMappingURL\s*=\s*(\S+)\s*\*+\//g,Wi=/(?:\n|\r\n)?\/\/[#@]+\s*sourceMappingURL\s*=\s*(\S+)\s*?$/gm;let Fa=class{static{g(this,"S")}static{Xe(this,"MapModifier")}map;constructor(t){if(typeof t=="string")try{this.map=JSON.parse(t)}catch{}else this.map=t}modify(t){return this.map?(t(this.map),this):this}modifySources(t){return this.map?(this.map.sources&&(this.map.sources=this.map.sources.map(i=>t(i))),this):this}resolve(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:P(t,i))}relative(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:Ce(i)?I(t,i):G(i))}toObject(){return this.map}toString(){return this.map?JSON.stringify(this.map):this.map}toConsumer(){return this.map?new uo(this.map):this.map}toCommentData(){const t=this.toString();return t?`
|
|
35
|
+
export = `+n+";"),{code:o.toString().replace(/export\s\{\s\s\};/,""),map:o.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var ma=Object.defineProperty,Lt=g((e,t)=>ma(e,"name",{value:t,configurable:!0}),"i$i");const Ri=Lt(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:Lt(async(n,o,a)=>{if(o.type!=="chunk"||!o.isEntry)return null;if(a.format==="cjs"&&a.exports==="auto"){const s=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(n);if(s===null||s.length<3)return null;const r=new ee(n);r.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),r.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&r.append(`
|
|
36
|
+
module.exports.default = `+s[2]+";");let p=r.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+o.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:r.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(o.fileName)?i!=="commonjs"&&o.fileName.endsWith(".d.mts")?null:Ai(n):null},"renderChunk")}),"cjsInteropPlugin");var fa=Object.defineProperty,ga=g((e,t)=>fa(e,"name",{value:t,configurable:!0}),"f$h");const ha=ga((e,t)=>{const i=new Map,n={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:o}=n;return Array.isArray(o)?o=o.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof o=="string"&&(o=[{src:o}]),{async buildStart(){const a=await Promise.all(o.flatMap(s=>Array.isArray(s.src)?s.src.map(r=>({...s,src:r})):s).map(async s=>await ro(mt(s.src),{ignore:mt(s.exclude).filter(Boolean)}).then(r=>({dest:s.dest??"",parent:so(s.src),src:r}))));for(const s of a)for(const r of s.src){let p;i.has(r)?p=i.get(r):(p={copied:[],dest:[],timestamp:0},i.set(r,p));const l=n.flatten?G(s.dest):$(s.dest,I(s.parent,_(r)));p.dest.includes(l)||p.dest.push(l),this.addWatchFile(r)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,r])=>{let p;try{const l=await kt(s);if(!l.isFile())return;const c=l.mtime.getTime();c>r.timestamp&&(r.timestamp=c,r.copied=[]),p=await De(s,{buffer:!0})}catch(l){t.error({context:[l],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const l of r.dest){if(n.copyOnce&&r.copied.includes(l))continue;const c=H(s),u=$(l,c);try{this.emitFile({[n.exactFileNames?"fileName":"name"]:u,source:p,type:"asset"}),t.debug({message:`copied ${s} → ${u}`,prefix:"plugin:copy"}),r.copied.push(l)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${u}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");function Fi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Fi,"getDefaultExportFromCjs");var st={exports:{}},Bt;function va(){return Bt||(Bt=1,function(e){var t=Object.defineProperty,i=g((c,u)=>t(c,"name",{value:u,configurable:!0}),"c"),n=Object.prototype.hasOwnProperty,o="~";function a(){}g(a,"Events"),i(a,"Events"),Object.create&&(a.prototype=Object.create(null),new a().__proto__||(o=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}g(s,"EE"),i(s,"EE");function r(c,u,d,m,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new s(d,m||c,v),x=o?o+u:u;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],h]:c._events[x].push(h):(c._events[x]=h,c._eventsCount++),c}g(r,"addListener"),i(r,"addListener");function p(c,u){--c._eventsCount===0?c._events=new a:delete c._events[u]}g(p,"clearEvent"),i(p,"clearEvent");function l(){this._events=new a,this._eventsCount=0}g(l,"EventEmitter"),i(l,"EventEmitter"),l.prototype.eventNames=i(function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)n.call(u,d)&&c.push(o?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},"eventNames"),l.prototype.listeners=i(function(c){var u=o?o+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var m=0,v=d.length,h=new Array(v);m<v;m++)h[m]=d[m].fn;return h},"listeners"),l.prototype.listenerCount=i(function(c){var u=o?o+c:c,d=this._events[u];return d?d.fn?1:d.length:0},"listenerCount"),l.prototype.emit=i(function(c,u,d,m,v,h){var x=o?o+c:c;if(!this._events[x])return!1;var f=this._events[x],k=arguments.length,b,y;if(f.fn){switch(f.once&&this.removeListener(c,f.fn,void 0,!0),k){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,u),!0;case 3:return f.fn.call(f.context,u,d),!0;case 4:return f.fn.call(f.context,u,d,m),!0;case 5:return f.fn.call(f.context,u,d,m,v),!0;case 6:return f.fn.call(f.context,u,d,m,v,h),!0}for(y=1,b=new Array(k-1);y<k;y++)b[y-1]=arguments[y];f.fn.apply(f.context,b)}else{var j=f.length,w;for(y=0;y<j;y++)switch(f[y].once&&this.removeListener(c,f[y].fn,void 0,!0),k){case 1:f[y].fn.call(f[y].context);break;case 2:f[y].fn.call(f[y].context,u);break;case 3:f[y].fn.call(f[y].context,u,d);break;case 4:f[y].fn.call(f[y].context,u,d,m);break;default:if(!b)for(w=1,b=new Array(k-1);w<k;w++)b[w-1]=arguments[w];f[y].fn.apply(f[y].context,b)}}return!0},"emit"),l.prototype.on=i(function(c,u,d){return r(this,c,u,d,!1)},"on"),l.prototype.once=i(function(c,u,d){return r(this,c,u,d,!0)},"once"),l.prototype.removeListener=i(function(c,u,d,m){var v=o?o+c:c;if(!this._events[v])return this;if(!u)return p(this,v),this;var h=this._events[v];if(h.fn)h.fn===u&&(!m||h.once)&&(!d||h.context===d)&&p(this,v);else{for(var x=0,f=[],k=h.length;x<k;x++)(h[x].fn!==u||m&&!h[x].once||d&&h[x].context!==d)&&f.push(h[x]);f.length?this._events[v]=f.length===1?f[0]:f:p(this,v)}return this},"removeListener"),l.prototype.removeAllListeners=i(function(c){var u;return c?(u=o?o+c:c,this._events[u]&&p(this,u)):(this._events=new a,this._eventsCount=0),this},"removeAllListeners"),l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=o,l.EventEmitter=l,e.exports=l}(st)),st.exports}g(va,"requireEventemitter3");var xa=va();const ya=Fi(xa);var ba=Object.defineProperty,he=g((e,t)=>ba(e,"name",{value:t,configurable:!0}),"o$8");class Li extends Error{static{g(this,"TimeoutError")}static{he(this,"TimeoutError")}constructor(t){super(t),this.name="TimeoutError"}}class wa extends Error{static{g(this,"AbortError")}static{he(this,"AbortError")}constructor(t){super(),this.name="AbortError",this.message=t}}const Jt=he(e=>globalThis.DOMException===void 0?new wa(e):new DOMException(e),"getDOMException"),qt=he(e=>{const t=e.reason===void 0?Jt("This operation was aborted."):e.reason;return t instanceof Error?t:Jt(t)},"getAbortedReason");function Bi(e,t){const{milliseconds:i,fallback:n,message:o,customTimers:a={setTimeout,clearTimeout}}=t;let s;const r=new Promise((p,l)=>{if(typeof i!="number"||Math.sign(i)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${i}\``);if(t.signal){const{signal:u}=t;u.aborted&&l(qt(u));const d=he(()=>{l(qt(u))},"abortHandler");u.addEventListener("abort",d,{once:!0}),e.finally(()=>{u.removeEventListener("abort",d)})}if(i===Number.POSITIVE_INFINITY){e.then(p,l);return}const c=new Li;s=a.setTimeout.call(void 0,()=>{if(n){try{p(n())}catch(u){l(u)}return}typeof e.cancel=="function"&&e.cancel(),o===!1?p():o instanceof Error?l(o):(c.message=o??`Promise timed out after ${i} milliseconds`,l(c))},i),(async()=>{try{p(await e)}catch(u){l(u)}})()}).finally(()=>{r.clear()});return r.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},r}g(Bi,"T$1");he(Bi,"pTimeout");var ka=Object.defineProperty,ja=g((e,t)=>ka(e,"name",{value:t,configurable:!0}),"i$h");function Ji(e,t,i){let n=0,o=e.length;for(;o>0;){const a=Math.trunc(o/2);let s=n+a;i(e[s],t)<=0?(n=++s,o-=a+1):o=a}return n}g(Ji,"r$f");ja(Ji,"lowerBound");var $a=Object.defineProperty,Ea=g((e,t)=>$a(e,"name",{value:t,configurable:!0}),"s$j");let Sa=class{static{g(this,"y")}static{Ea(this,"PriorityQueue")}#e=[];enqueue(t,i){i={priority:0,...i};const n={priority:i.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=i.priority){this.#e.push(n);return}const o=Ji(this.#e,n,(a,s)=>s.priority-a.priority);this.#e.splice(o,0,n)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(i=>i.priority===t.priority).map(i=>i.run)}get size(){return this.#e.length}};var Oa=Object.defineProperty,Wt=g((e,t)=>Oa(e,"name",{value:t,configurable:!0}),"n$c");let Pa=class extends ya{static{g(this,"d")}static{Wt(this,"PQueue")}#e;#i;#a=0;#r;#s;#f=0;#n;#p;#t;#g;#o=0;#c;#l;#h;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Sa,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#i=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#g=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#h=t.throwOnTimeout===!0,this.#l=t.autoStart===!1}get#y(){return this.#i||this.#a<this.#r}get#b(){return this.#o<this.#c}#w(){this.#o--,this.#d(),this.emit("next")}#k(){this.#x(),this.#v(),this.#p=void 0}get#j(){const t=Date.now();if(this.#n===void 0){const i=this.#f-t;if(i<0)this.#a=this.#e?this.#o:0;else return this.#p===void 0&&(this.#p=setTimeout(()=>{this.#k()},i)),!0}return!1}#d(){if(this.#t.size===0)return this.#n&&clearInterval(this.#n),this.#n=void 0,this.emit("empty"),this.#o===0&&this.emit("idle"),!1;if(!this.#l){const t=!this.#j;if(this.#y&&this.#b){const i=this.#t.dequeue();return i?(this.emit("active"),i(),t&&this.#v(),!0):!1}}return!1}#v(){this.#i||this.#n!==void 0||(this.#n=setInterval(()=>{this.#x()},this.#s),this.#f=Date.now()+this.#s)}#x(){this.#a===0&&this.#o===0&&this.#n&&(clearInterval(this.#n),this.#n=void 0),this.#a=this.#e?this.#o:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#u()}async#$(t){return new Promise((i,n)=>{t.addEventListener("abort",()=>{n(t.reason)},{once:!0})})}async add(t,i={}){return i={timeout:this.timeout,throwOnTimeout:this.#h,...i},new Promise((n,o)=>{this.#t.enqueue(async()=>{this.#o++,this.#a++;try{i.signal?.throwIfAborted();let a=t({signal:i.signal});i.timeout&&(a=Bi(Promise.resolve(a),{milliseconds:i.timeout})),i.signal&&(a=Promise.race([a,this.#$(i.signal)]));const s=await a;n(s),this.emit("completed",s)}catch(a){if(a instanceof Li&&!i.throwOnTimeout){n();return}o(a),this.emit("error",a)}finally{this.#w()}},i),this.emit("add"),this.#d()})}async addAll(t,i){return Promise.all(t.map(async n=>this.add(n,i)))}start(){return this.#l?(this.#l=!1,this.#u(),this):this}pause(){this.#l=!0}clear(){this.#t=new this.#g}async onEmpty(){this.#t.size!==0&&await this.#m("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#m("next",()=>this.#t.size<t)}async onIdle(){this.#o===0&&this.#t.size===0||await this.#m("idle")}async#m(t,i){return new Promise(n=>{const o=Wt(()=>{i&&!i()||(this.off(t,o),n())},"listener");this.on(t,o)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#o}get isPaused(){return this.#l}};var Da=Object.defineProperty,Ca=g((e,t)=>Da(e,"name",{value:t,configurable:!0}),"r$e");const Ut=Ca((e,t)=>{if(!t)return!1;if(typeof t=="function")return t(e);if(typeof t.test=="function")return t.test(e);throw new Error("Invalid condition type")},"matchFile");var Na=Object.defineProperty,Ma=g((e,t)=>Na(e,"name",{value:t,configurable:!0}),"a$t");const _a=4,Ta=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):_a;let Ia=class{static{g(this,"f")}static{Ma(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:i,logger:n,options:o}){this.test=a=>t.some(s=>a.toLowerCase().endsWith(s)),i.length>0&&this.add(...i),this.options=o,this.logger=n}add(...t){for(const i of t)this.loaders.has(i.name)||this.loaders.set(i.name,i)}isSupported(t){if(this.test(t))return!0;for(const[,i]of this.loaders)if(Ut(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new Pa({concurrency:Ta-1}));for await(const[n,o]of this.loaders){const a={...i,options:this.options[n]??{}};if(o.alwaysProcess||Ut(a.id,o.test)){this.logger.debug(`Processing ${n} loader for ${a.id}`);const s=await this.workQueue.add(o.process.bind(a,t));s&&(t=s)}}return t}};const za=/data:[^\n\r;]+(?:;charset=[^\n\r;]+)?;base64,([\d+/A-Za-z]+={0,2})/;var Aa=Object.defineProperty,Xe=g((e,t)=>Aa(e,"name",{value:t,configurable:!0}),"i$g");const qi=/(?:\n|\r\n)?\/\*[#*@]+\s*sourceMappingURL\s*=\s*(\S+)\s*\*+\//g,Wi=/(?:\n|\r\n)?\/\/[#@]+\s*sourceMappingURL\s*=\s*(\S+)\s*?$/gm;let Ra=class{static{g(this,"S")}static{Xe(this,"MapModifier")}map;constructor(t){if(typeof t=="string")try{this.map=JSON.parse(t)}catch{}else this.map=t}modify(t){return this.map?(t(this.map),this):this}modifySources(t){return this.map?(this.map.sources&&(this.map.sources=this.map.sources.map(i=>t(i))),this):this}resolve(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:P(t,i))}relative(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:Ce(i)?I(t,i):G(i))}toObject(){return this.map}toString(){return this.map?JSON.stringify(this.map):this.map}toConsumer(){return this.map?new co(this.map):this.map}toCommentData(){const t=this.toString();return t?`
|
|
37
37
|
/*# sourceMappingURL=data:application/json;base64,${Buffer.from(t).toString("base64")} */`:""}toCommentFile(t){return this.map?`
|
|
38
|
-
/*# sourceMappingURL=${t} */`:""}};Xe(async(e,t)=>{const[,i]=qi.exec(e)??Wi.exec(e)??[];if(!i)return;const[,n]=
|
|
38
|
+
/*# sourceMappingURL=${t} */`:""}};Xe(async(e,t)=>{const[,i]=qi.exec(e)??Wi.exec(e)??[];if(!i)return;const[,n]=za.exec(i)??[];if(n)return Buffer.from(n,"base64").toString();if(!t)throw new Error("Extracted map detected, but no ID is provided");const o=P(_(t),i);if(L(o))return He(o)},"getMap");Xe(e=>e.replaceAll(qi,"").replaceAll(Wi,""),"stripMap");const ft=Xe(e=>new Ra(e),"mm");var Fa=Object.defineProperty,La=g((e,t)=>Fa(e,"name",{value:t,configurable:!0}),"u$f");const Ba=La(async e=>{const t=new uo({file:""}),i=[];let n=0;for await(const{css:o,map:a}of e){i.push(o);const s=ft(a),r=s.toObject();if(!r)continue;const p=s.toConsumer();if(p){if(p.eachMapping(l=>{t.addMapping({generated:{column:l.generatedColumn,line:n+l.generatedLine},name:l.name,original:{column:l.originalColumn,line:l.originalLine},source:l.source})}),r.sourcesContent)for(const l of r.sources)t.setSourceContent(l,p.sourceContentFor(l,!0));n+=o.split(`
|
|
39
39
|
`).length}}return{css:i.join(`
|
|
40
|
-
`),map:t}},"concat");var
|
|
41
|
-
`)),
|
|
42
|
-
`));const
|
|
40
|
+
`),map:t}},"concat");var Ja=Object.defineProperty,qa=g((e,t)=>Ja(e,"name",{value:t,configurable:!0}),"s$i");const Ui=qa(e=>e.map((t,i,n)=>{const o=`\`${t}\``;switch(i){case n.length-1:return`or ${o}`;case n.length-2:return o;default:return`${o},`}}).join(" "),"default");var Wa=Object.defineProperty,Ua=g((e,t)=>Wa(e,"name",{value:t,configurable:!0}),"l$e");const Va=_(Ci(import.meta.url)),Vt=Ua((e,t)=>{const i={baseDirs:[Va],caller:"Resolver",extensions:[".mjs",".js",".cjs",".json"],symlinks:!0,...t},n=new Ni({extensions:i.extensions,symlinks:i.symlinks});for(const o of i.baseDirs)for(const a of e)try{const{error:s,path:r}=n.sync(o,a);if(r)return r;s&&console.debug(s,{context:[{basedir:o,caller:t.caller,extensions:t.extensions,id:a}]})}catch(s){console.debug(s.message,{context:[{basedir:o,caller:t.caller,error:s,extensions:t.extensions,id:a}]})}throw new Error(`${i.caller} could not resolve ${Ui(e)}`)},"resolve");var Ka=Object.defineProperty,Ga=g((e,t)=>Ka(e,"name",{value:t,configurable:!0}),"o$6");const re={},Ha=[".js",".mjs",".cjs",".json"],Ya=Ga(async(e,t)=>{if(re[e])return re[e];if(re[e]===null)return;const i={baseDirs:[t],caller:"Module loader",extensions:Ha,symlinks:!1};try{re[e]=require(Vt([e,`./${e}`],i))}catch(o){if(o.code==="ERR_REQUIRE_ESM")try{re[e]=mo(await fo(Vt([e,`./${e}`],i)))}catch{}else{re[e]=null;return}}const n=re[e];return n?.default??n},"default");var Xa=Object.defineProperty,ve=g((e,t)=>Xa(e,"name",{value:t,configurable:!0}),"r$d");const Vi=["inject","extract","emit"],Qa=Ui(Vi),Za=ve(e=>{const t=Array.isArray(e)?e:[e];if(t[0]&&!Vi.includes(t[0]))throw new Error(`Incorrect mode provided, allowed modes are ${Qa}`);return{emit:t[0]==="emit",extract:t[0]==="extract"&&(t[1]??!0),inject:(!t[0]||t[0]==="inject")&&(t[1]??!0)}},"inferModeOption"),gt=ve((e,t)=>typeof e=="boolean"?e&&{}:typeof e=="object"?e:t,"inferOption"),es=ve(e=>{const t=Array.isArray(e)?e:[e];return t[0]?{content:!0,...t[1],inline:t[0]==="inline"}:!1},"inferSourceMapOption"),Kt=ve((e,t)=>{const i=gt(e,{});return t&&typeof i=="object"&&!i.alias&&(i.alias=t),i},"inferHandlerOption"),ge=ve(async(e,t,i)=>{if(typeof e!="string")return e;const n=await Ya(e,i);if(!n)throw new Error(`Unable to load PostCSS ${t} \`${e}\``);return n},"ensurePCSSOption"),ts=ve(async(e,t)=>{if(e===void 0)return[];if(e.length===0)return[];const i=[];for await(const n of e.filter(Boolean)){if(!Array.isArray(n)){i.push(await ge(n,"plugin",t));continue}const[o,a]=n;a?i.push((await ge(o,"plugin",t))(a)):i.push(await ge(o,"plugin",t))}return i},"ensurePCSSPlugins");var is=Object.defineProperty,$e=g((e,t)=>is(e,"name",{value:t,configurable:!0}),"b$4");const ns=$e(async(e,t)=>e.sort((i,n)=>t.indexOf(i.name)-t.indexOf(n.name)),"sortByNameOrder"),os=$e(async(e,t,i,n,o,a,s,r,p,l)=>{const c={...l,...e.alias},u=Y(e.include,e.exclude),d=es(e.sourceMap),m={...Za(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof m.inject=="object"&&m.inject.treeshakeable&&(m.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let v=!1;if(e.loaders)for(const k of e.loaders)k.name==="postcss"&&(v=!0);else e.loaders=[];v&&(m.postcss={...e.postcss,config:gt(e.postcss?.config,{}),import:Kt(e.postcss?.import,c),modules:gt(e.postcss?.modules,void 0),to:e.postcss?.to,url:Kt(e.postcss?.url,c)},e.postcss?.parser&&(m.postcss.parser=await ge(e.postcss.parser,"parser",n)),e.postcss?.syntax&&(m.postcss.syntax=await ge(e.postcss.syntax,"syntax",n)),e.postcss?.stringifier&&(m.postcss.stringifier=await ge(e.postcss.stringifier,"stringifier",n)),e.postcss?.plugins&&(m.postcss.plugins=await ts(e.postcss.plugins,n)));const h=new Ia({extensions:m.extensions,loaders:await ns(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...m,alias:c}});let x=[];const f=$e((k,b)=>{const y=[];for(const j of Object.keys(k)){const w=new Set;let S=[j];do{const N=[];for(const M of S){if(w.has(M))continue;if(h.isSupported(M)){u(M)&&N.push(M);continue}w.add(M);const X=b(M);X&&N.push(...X.importedIds)}S=N}while(S.some(N=>!h.isSupported(N)));y.push(...S)}return y},"traverseImportedModules");return{augmentChunkHash(k){if(x.length===0)return null;const b=f(k.modules,this.getModuleInfo),y=x.filter(j=>b.includes(j.id)).sort((j,w)=>b.lastIndexOf(j.id)-b.lastIndexOf(w.id)).map(j=>`${H(j.id)}:${j.css}`);return y.length===0?null:y.join(":")},async generateBundle(k,b){if(x.length===0||!(k.dir||k.file))return;const y=Object.values(b),j=k.dir??_(k.file),w=y.filter(O=>O.type==="chunk"),S=w.filter(O=>!O.facadeModuleId),N=k.preserveModules?w:w.filter(O=>O.isEntry||O.isDynamicEntry),M=[],X=$e(async(O,T)=>{const E=typeof m.extract=="string"?G(m.extract).replace(/^\.[/\\]/,""):G(`${O}.css`);Ce(E)&&this.error(["Extraction path must be relative to the output directory,",`which is ${I(n,j)}`].join(`
|
|
41
|
+
`)),jt(E)&&this.error(["Extraction path must be nested inside output directory,",`which is ${I(n,j)}`].join(`
|
|
42
|
+
`));const B=x.filter(U=>T.includes(U.id)).sort((U,ue)=>T.lastIndexOf(U.id)-T.lastIndexOf(ue.id)),Te=await Ba(B);return{css:Te.css,map:ft(Te.map.toString()).relative(_(P(j,E))).toString(),name:E}},"getExtractedData"),Q=$e(O=>{if(k.file)return ot(k.file).name;if(k.preserveModules){const{dir:T,name:E}=ot(O.fileName);return T?$(T,E):E}return O.name},"getName"),z=[];if(typeof m.extract=="string"){t.debug({message:`Extracting to ${m.extract}`,prefix:"css"});const O=[];for(const E of S){const B=f(E.modules,this.getModuleInfo);z.push(...B),O.push(...B)}for(const E of N)O.push(...f(E.modules,this.getModuleInfo).filter(B=>!z.includes(B)));const T=Q(w[0]);M.push([T,O])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const O of S){const T=f(O.modules,this.getModuleInfo);if(T.length===0)continue;z.push(...T);const E=Q(O);M.push([E,T])}for(const O of N){const T=f(O.modules,this.getModuleInfo).filter(B=>!z.includes(B));if(T.length===0)continue;const E=Q(O);M.push([E,T])}}for await(const[O,T]of M){const E=await X(O,T);if(typeof e.onExtract=="function"&&!e.onExtract(E))continue;if(p&&e.minifier){t.info({message:`Minifying ${E.name} with ${e.minifier.name}`,prefix:"css"});const{css:U,map:ue}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})(E,d,e[e.minifier.name]??{});E.css=U,E.map=ue}const B={fileName:E.name,name:E.name,names:[E.name],originalFileName:E.name,originalFileNames:[E.name],source:E.css,type:"asset"},Te=this.emitFile(B);if(E.map&&d){const U=this.getFileName(Te),ue=typeof k.assetFileNames=="string"?G(_(k.assetFileNames)):typeof k.assetFileNames=="function"?G(_(k.assetFileNames(B))):"assets",xe=ft(E.map).modify(A=>(A.file=H(U),A)).modifySources(A=>{if(A==="<no source>"||ue.length<=1)return A;A=`../${A}`;for(const nt of ue)nt==="/"&&(A=`../${A}`);return A});if(d.inline)xe.modify(A=>d.transform?.(A,G($(j,U)))),b[U].source+=xe.toCommentData();else{const A=`${U}.map`;xe.modify(kn=>d.transform?.(kn,G($(j,A)))),this.emitFile({fileName:A,source:xe.toString(),type:"asset"});const{base:nt}=ot(A);b[U].source+=xe.toCommentFile(nt)}}}},name:"packem:css",async transform(k,b){if(!u(b)||!h.isSupported(b)||k.replaceAll(/\s/g,"")==="")return null;try{return this.parse(k,{}),this.warn(`Skipping processed file ${I(n,b)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(k,b);const y={alias:c,assets:new Map,autoModules:m.autoModules,browserTargets:i,cwd:n,debug:r,deps:new Set,dts:m.dts,emit:m.emit,environment:a,extensions:m.extensions,extract:m.extract,id:b,inject:m.inject,logger:t,namedExports:m.namedExports,options:{},plugin:this,sourceDir:o,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},j=await h.process({code:k},y);for(const w of y.deps)this.addWatchFile(w);for(const[w,S]of y.assets)this.emitFile({fileName:w,source:S,type:"asset"});if(j.extracted){const{id:w}=j.extracted;x=x.filter(S=>S.id!==w),x.push(j.extracted)}return{code:j.code,map:d&&j.map?j.map:{mappings:""},meta:{styles:j.meta},moduleSideEffects:j.extracted?!0:null}}}},"default");var as=Object.defineProperty,ss=g((e,t)=>as(e,"name",{value:t,configurable:!0}),"t$e");const rs=/\.module\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,rt=ss((e,t)=>e===void 0?!0:typeof e=="function"?e(t):e instanceof RegExp?e.test(t):e&&rs.test(t),"ensureAutoModules");var ls=Object.defineProperty,ps=g((e,t)=>ls(e,"name",{value:t,configurable:!0}),"u$c");const cs=`
|
|
43
43
|
/* eslint-disable */
|
|
44
44
|
/* prettier-ignore */
|
|
45
45
|
// @ts-nocheck
|
|
@@ -47,22 +47,22 @@ module.exports.default = `+s[2]+";");let p=r.toString();return p=p.replace(/(?:m
|
|
|
47
47
|
* Generated by packem
|
|
48
48
|
* @see https://npmjs.com/@visulima/packem
|
|
49
49
|
*/
|
|
50
|
-
`.trim(),
|
|
51
|
-
${r}`),i.info({message:`Generated types for ${G(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var
|
|
50
|
+
`.trim(),ds=ps((e,t,i)=>{let n;return e.postcss&&typeof e.postcss.modules=="boolean"?n=e.postcss.modules:e.lightningcss&&typeof e.lightningcss.modules=="boolean"&&(n=e.lightningcss.modules),{async transform(o,a){let s=n;if(e.postcss&&typeof e.postcss.modules=="object"?s=rt(e.postcss.modules.include,a):e.lightningcss&&typeof e.lightningcss.modules=="object"&&(s=rt(e.lightningcss.modules.include,a)),e.autoModules&&s===void 0&&(s=rt(e.autoModules,a)),!s)return null;const{types:r}=this.getModuleInfo(a)?.meta.styles??{};return r===void 0||await Ge(a)&&(await bi(a+".d.ts",`${cs}
|
|
51
|
+
${r}`),i.info({message:`Generated types for ${G(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var us=Object.defineProperty,ms=g((e,t)=>us(e,"name",{value:t,configurable:!0}),"r$c");const fs=new Set(["es","chrome","edge","firefox","ios","node","safari","opera","ie"]),gs=["android 4"],hs={android:"chrome",ios_saf:"ios"},vs=" ",Gt=ms(e=>{let t=e.filter(i=>!gs.some(n=>i.startsWith(n))).map(i=>i.split(vs)).map(([i,n])=>[hs[i]||i,n]).map(([i,n])=>[i,n.includes("-")?n.slice(0,n.indexOf("-")):n]).map(([i,n])=>[i,n.endsWith(".0")?n.slice(0,-2):n]).filter(([,i])=>/^\d+(\.\d+)*$/.test(i)).filter(([i])=>fs.has(i));return t=Object.entries(Object.fromEntries(t)),t.map(([i,n])=>`${i}${n}`)},"browserslistToEsbuild");var xs=Object.defineProperty,Qe=g((e,t)=>xs(e,"name",{value:t,configurable:!0}),"t$d");const ys=/(?:^|[^.\w'"`])require(\.resolve)?\(\s*([\w'"`])/,bs=Qe((e,t)=>{if(Sn.INTERNAL_PACKEM_BUILD!=="1"&&(e.includes("// -- packem CommonJS __filename shim")||e.includes("// -- packem CommonJS __dirname shim")||e.includes("// -- packem CommonJS require shim")))return null;let i=!1,n=!1,o=!1;if(e.includes("__filename")&&(i=!0),e.includes("__dirname")&&(n=!0),ys.test(e)&&(o=!0),!i&&!n&&!o)return null;const a=Di(e).pop(),s=a?a.end:0,r=new ee(e);return r.appendRight(s,t(i,n,o)),{code:r.toString(),map:r.generateMap()}},"CJSToESM"),ws=Qe((e,t,i)=>{let n="";return(e||t)&&(n+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
|
|
52
52
|
`),t&&(n+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
|
|
53
53
|
`),i&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
54
54
|
`),(e||t)&&(n+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
55
55
|
`),t&&(n+=`const __dirname = __cjs_path__.dirname(__filename);
|
|
56
56
|
`),i&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
|
|
57
|
-
`),n},"generateCJSShim"),
|
|
57
|
+
`),n},"generateCJSShim"),ks=Qe((e,t,i)=>{let n="";return i&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
58
58
|
`),e&&(n+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
|
|
59
59
|
`),t&&(n+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
|
|
60
60
|
`),i&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
|
|
61
|
-
`),n},"generateCJSShimNode20_11")
|
|
61
|
+
`),n},"generateCJSShimNode20_11"),js=Qe((e,t)=>{const i=Y(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(n,o,a){if(a.format==="es"&&i(o.fileName)){let s=ws;if(e.engines?.node){const r=Pi(e.engines.node);r&&r.major>=20&&r.minor>=11&&(s=ks)}return bs(n,s)}return null}}},"esmShimCjsSyntaxPlugin");var $s=Object.defineProperty,Es=g((e,t)=>$s(e,"name",{value:t,configurable:!0}),"m$9");const Ss=Es(()=>({name:"packem:fix-dynamic-import-extension",renderChunk(e,t,i){return i.format==="es"||i.format==="cjs"?{code:e.replaceAll(/(import\(.*)(\.ts)(['´"`]\))/g,"$1."+(i.format==="es"?"mjs":"cjs")+"$3"),map:null}:null}}),"fixDynamicImportExtension");var Os=Object.defineProperty,Ps=g((e,t)=>Os(e,"name",{value:t,configurable:!0}),"e$8");const Ht=/^([\w-]+):/,Yt=Ps(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=Ht.exec(e);i&&(t.push(i[1]),e=e.replace(Ht,""));const n=e.split("/");for(const o of n)(o.includes("*")||o)&&t.push(o);return t},"splitTsconfigPathKey");var Ds=Object.defineProperty,Cs=g((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"h$2");const Ns=Cs((e,t)=>{const i=e.replace(/^\.\//,""),n=t.replace(/^\.\//,"");if(n.startsWith(i))return e+n.slice(i.length);if(e.endsWith(t))return e;const o=Yt(e),a=Yt(t);let s=o.length-1,r=a.length-1;for(;s>=0&&r>=0&&o[s]===a[r];)s--,r--;let p=o.slice(0,s).join("/");const l=a.slice(r).join("/");return(!p.startsWith(".")||p==="")&&(p="./"+p),p+(l?"/"+l:"")},"extendString");var Ms=Object.defineProperty,_s=g((e,t)=>Ms(e,"name",{value:t,configurable:!0}),"s$h");const Ts=_s((...e)=>{if(e.length===0)return"";if(e.length===1)return _(e[0]);e=e.map(o=>Le(o));const[t,...i]=e;let n=t.split("/");for(const o of i){const a=o.split("/",n.length);let s=0;for(const r of a)if(r===n[s])s+=1;else{n=n.slice(0,s);break}n=n.slice(0,s)}return n.length<=1&&n[0]===""?`/${n[0]}`:n.join("/")},"lowestCommonAncestor");var Is=Object.defineProperty,Pe=g((e,t)=>Is(e,"name",{value:t,configurable:!0}),"d$e");const Xt=Pe((e,t)=>`${e}
|
|
62
62
|
//# sourceMappingURL=${H(t)}.map
|
|
63
|
-
`,"appendMapUrl"),
|
|
63
|
+
`,"appendMapUrl"),Qt=Pe((e,t,i)=>JSON.stringify({file:H(i),mappings:e,names:[],sourceRoot:"",sources:[I(_(i),t)],version:3}),"generateDtsMap"),zs=Pe((e,t,i,n,o,a,s,r)=>{const p=Y(a.include,a.exclude);let l=Object.create(null);const c=Pe((m,v)=>{l[m.replace(se,"")]={...v,ext:Ne(m)}},"addOutput");let u=[];r?.config.compilerOptions&&(u=Object.entries(r.config.compilerOptions.paths??{}).map(([m])=>m.endsWith("*")?new RegExp(`^${m.replace("*","(.*)")}$`):new RegExp(`^${m}$`)));async function d(m,v){if(!p(v))return;let h;try{h=(await vo(v,m)).program}catch(y){o.debug({message:y.message,prefix:"packem:isolated-declarations"})}if(h){const y=h.body.filter(j=>(j.type==="ImportDeclaration"||j.type==="ExportAllDeclaration"||j.type==="ExportNamedDeclaration")&&!!j.source);for await(const j of y){if(H(j.source.value).includes("."))continue;const w=await this.resolve(j.source.value,v);if(!(!w||w.external)&&(w.id.endsWith(".ts")||w.id.endsWith(".cts")||w.id.endsWith(".mts")||w.id.endsWith(".tsx")||w.id.endsWith(".ctsx")||w.id.endsWith(".mtsx"))){const S=w.id.replace(e+"/","");let N=j.source.value;u.some(M=>M.test(j.source.value))&&!j.source.value.startsWith(".")&&(N="./"+j.source.value),m=m.replaceAll('from "'+j.source.value+'"','from "'+Ns(N,S)+'"')}}}const{errors:x,map:f,sourceText:k}=await t(v,m,s,r?.config?.compilerOptions);if(x.length>0){if(a.ignoreErrors){this.warn(x[0]);return}return this.error(x[0])}if(c(v,{map:f,source:k}),!h)return;const b=h.body.filter(y=>y.type==="ImportDeclaration"?y.importKind==="type"?!0:y.specifiers?.every(j=>j.type==="ImportSpecifier"&&j.importKind==="type"):y.type==="ExportNamedDeclaration"||y.type==="ExportAllDeclaration"?y.exportKind==="type"?!0:y.type==="ExportNamedDeclaration"&&y.specifiers?.every(j=>j.type==="ExportSpecifier"&&j.exportKind==="type"):!1);for await(const y of b){if(!y.source)continue;const j=await this.resolve(y.source.value,v);if(!j)return;const w=j.id;if(p(w)&&!l[w.replace(se,"")])try{const S=await De(w);await d.call(this,S,w)}catch{}}}return g(d,"w"),Pe(d,"transform"),{buildStart(){l=Object.create(null)},name:"packem:isolated-declarations",async renderStart(m,{input:v}){const h=Ts(...Array.isArray(v)?v:Object.values(v));o.debug({message:"Input base:"+h,prefix:"packem:isolated-declarations"}),typeof m.entryFileNames=="function"&&(m.entryFileNames=m.entryFileNames({name:m.name}));const x=m.entryFileNames.replace(/\.(.)?[jt]sx?$/,(f,k)=>`.d.${k||""}ts`);for await(let[f,{ext:k,map:b,source:y}]of Object.entries(l)){if(n&&m.format==="cjs"){const N=Ai(y);N!==null&&(y=N.code)}const j=y.includes("from '")?"'":'"',w=f+k;if((i===!0||i==="compatible")&&m.format==="cjs"){o.debug({message:"Emit compatible dts file: "+f,prefix:"packem:isolated-declarations"});const N=x.replace("[name]",I(h,f)).replace(".cts",".ts");let M=y;s&&b&&(M=Xt(M.trim(),N),this.emitFile({fileName:`${N}.map`,originalFileName:w,source:Qt(b,w,$(m.dir,N)),type:"asset"})),this.emitFile({fileName:N,originalFileName:w,source:M.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(X,Q,z,O)=>Q+j+(O||z)+".d.ts"+j+";"),type:"asset"})}o.debug({message:"Emit dts file: "+f,prefix:"packem:isolated-declarations"});const S=x.replace("[name]",I(h,f));s&&b&&(y=Xt(y.trim(),S),this.emitFile({fileName:`${S}.map`,originalFileName:w,source:Qt(b,w,$(m.dir,S)),type:"asset"})),this.emitFile({fileName:S,originalFileName:w,source:y.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(N,M,X,Q)=>M+j+(Q||X)+(m.format==="cjs"?".d.cts":".d.mts")+j+";"),type:"asset"})}},transform:d}},"isolatedDeclarationsPlugin");var As=Object.defineProperty,Rs=g((e,t)=>As(e,"name",{value:t,configurable:!0}),"n$9");const Zt="export default ",Ki=Rs(e=>{const t=xo(e);return{...t,name:"packem:json",transform(i,n){const o=t.transform?.call(this,i,n);return o&&typeof o!="string"&&"code"in o&&o.code?.startsWith(Zt)&&(o.code=o.code.replace(Zt,"module.exports = ")),o}}},"JSONPlugin");var Fs=Object.defineProperty,ze=g((e,t)=>Fs(e,"name",{value:t,configurable:!0}),"i$d");class Gi{static{g(this,"WalkerBase")}static{ze(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ze(()=>this.should_skip=!0,"skip"),remove:ze(()=>this.should_remove=!0,"remove"),replace:ze(t=>this.replacement=t,"replace")}}replace(t,i,n,o){t&&i&&(n!=null?t[i][n]=o:t[i]=o)}remove(t,i,n){t&&i&&(n!=null?t[i].splice(n,1):delete t[i])}}var Ls=Object.defineProperty,Ee=g((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"c$h");class Bs extends Gi{static{g(this,"SyncWalker")}static{Ee(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Ee(()=>this.should_skip=!0,"skip"),remove:Ee(()=>this.should_remove=!0,"remove"),replace:Ee(n=>this.replacement=n,"replace")},this.enter=t,this.leave=i}visit(t,i,n,o){if(t){if(this.enter){const s=this.should_skip,r=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,i,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const l=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=p,l)return t;if(c)return null}let a;for(a in t){const s=t[a];if(s&&typeof s=="object")if(Array.isArray(s)){const r=s;for(let p=0;p<r.length;p+=1){const l=r[p];ht(l)&&(this.visit(l,t,a,p)||p--)}}else ht(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,r=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,i,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const p=this.should_remove;if(this.replacement=s,this.should_remove=r,p)return null}}return t}}function ht(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(ht,"n$8");Ee(ht,"isNode");var Js=Object.defineProperty,Se=g((e,t)=>Js(e,"name",{value:t,configurable:!0}),"c$g");class qs extends Gi{static{g(this,"AsyncWalker")}static{Se(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Se(()=>this.should_skip=!0,"skip"),remove:Se(()=>this.should_remove=!0,"remove"),replace:Se(n=>this.replacement=n,"replace")},this.enter=t,this.leave=i}async visit(t,i,n,o){if(t){if(this.enter){const s=this.should_skip,r=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,i,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const l=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=r,this.replacement=p,l)return t;if(c)return null}let a;for(a in t){const s=t[a];if(s&&typeof s=="object")if(Array.isArray(s)){const r=s;for(let p=0;p<r.length;p+=1){const l=r[p];vt(l)&&(await this.visit(l,t,a,p)||p--)}}else vt(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,r=this.should_remove;this.replacement=null,this.should_remove=!1,await this.leave.call(this.context,t,i,n,o),this.replacement&&(t=this.replacement,this.replace(i,n,o,t)),this.should_remove&&this.remove(i,n,o);const p=this.should_remove;if(this.replacement=s,this.should_remove=r,p)return null}}return t}}function vt(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(vt,"a$n");Se(vt,"isNode");var Ws=Object.defineProperty,Hi=g((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"a$m");function Ot(e,{enter:t,leave:i}){return new Bs(t,i).visit(e,null)}g(Ot,"walk");Hi(Ot,"walk");async function Us(e,{enter:t,leave:i}){return await new qs(t,i).visit(e,null)}g(Us,"asyncWalk");Hi(Us,"asyncWalk");var Vs=Object.defineProperty,Ks=g((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"u$a");const Gs=Ks(({attributes:e,logger:t})=>{const i=Y([/\.[tj]sx$/],/node_modules/);if(!Array.isArray(e)||e.length===0)throw new Error("[packem:jsx-remove-attributes]: attributes must be a non-empty array of strings.");return{name:"packem:jsx-remove-attributes",transform(n,o){if(!i(o))return null;let a=null;try{a=this.parse(n,{allowReturnOutsideFunction:!0})}catch(p){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${o}" and remove the jsx attribute.`}),t.warn(p),null}let s=!1;const r=new ee(n);return Ot(a,{enter(p){if(p.type==="CallExpression"&&p.callee.type==="Identifier"&&p.callee.name==="jsx"){const l=p.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of l)for(const u of c.properties)u.type==="Property"&&u.key.type==="Literal"&&u.value.type==="Literal"&&e.includes(u.key.value)&&(r.overwrite(u.start-2,u.end,""),s=!0)}}}),s?{code:r.toString(),map:r.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var Hs=Object.defineProperty,Ys=g((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"r$a");const Xs=Ys((e,t,i)=>{const n=new RegExp(`(<!-- ${t} -->)[\\s\\S]*?(<!-- /${t} -->)`,"g");if(n.test(e))return e.replace(n,`$1
|
|
64
64
|
${i}
|
|
65
|
-
$2`)},"replaceContentWithin");var
|
|
65
|
+
$2`)},"replaceContentWithin");var Qs=Object.defineProperty,Yi=g((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"d$d");const Zs=Yi(e=>{const t=[],i=[];return e.forEach(n=>{n.startsWith("(")?t.push(n):i.push(n)}),[...i.sort(),...t.sort()]},"sortLicenses"),Xi=Yi(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:n,marker:o,mode:a,packageName:s})=>yo({thirdParty(r){const p=new Set,l=r.sort(({name:u},{name:d})=>(u||0)>(d||0)?1:(d||0)>(u||0)?-1:0).map(({author:u,contributors:d,license:m,licenseText:v,maintainers:h,name:x,repository:f})=>{let k="## "+x+`
|
|
66
66
|
`;m&&(k+=`License: ${m}
|
|
67
67
|
`);const b=new Set;for(const y of[u,...h,...d]){const j=typeof y=="string"?y:y?.name;j&&b.add(j)}return b.size>0&&(k+=`By: ${[...b].join(", ")}
|
|
68
68
|
`),f&&(k+=`Repository: ${typeof f=="string"?f:f.url}
|
|
@@ -74,25 +74,25 @@ $2`)},"replaceContentWithin");var Zs=Object.defineProperty,Yi=g((e,t)=>Zs(e,"nam
|
|
|
74
74
|
`),m&&p.add(m),k}).join(`
|
|
75
75
|
---------------------------------------
|
|
76
76
|
|
|
77
|
-
`);if(l===""){n.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(
|
|
77
|
+
`);if(l===""){n.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(Zs(p),l,s);try{const u=He(t),d=Xs(u,o,c);if(!d){n.error({message:`Could not find the license marker: <!-- ${o} --><!-- /${o} --> in ${t}`,prefix:"plugin:license:"+a});return}u!==d&&(ce(t,d),n.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(u){n.error(u)}}}),"license");var er=Object.defineProperty,tr=g((e,t)=>er(e,"name",{value:t,configurable:!0}),"u$9");const ir=tr(()=>({async generateBundle(e,t){const i=[];for(const o of this.getModuleIds()){const a=this.getModuleInfo(o);if(a!=null&&!a.isExternal)for(const s of a.importedIds)i.push({source:o,target:s})}if(Array.isArray(i)&&i.length===0)return;const n=Object.keys(t);this.emitFile({fileName:`metafile-${n[0].replace(se,"")}-${e.format}.json`,source:JSON.stringify(i,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var nr=Object.defineProperty,xt=g((e,t)=>nr(e,"name",{value:t,configurable:!0}),"a$l");let ei=!1;const le={},or=xt(e=>Object.fromEntries(Object.entries(e).map(([t,i])=>{if(!i)return[t,{}];const n=Object.fromEntries(Object.entries(i).map(([o,a])=>Array.isArray(a)?[o,[...new Set(a)]]:[o,[]]));return[t,n]})),"uniqueNestedValues"),ar=xt((e,t,i,n,o,a)=>{if(a!=="*"&&no(oo(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle:xt(async()=>{ei||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:packem:node10-compatibility"}),ei=!0);for(const p of t)for(const l of p.exportKey)l.includes("/*")?le[l]=["./"+$(i,_(p.name),"*.d.ts")]:le[l]=[...le[l]??[],"./"+$(i,p.name+".d.ts")];const s=$(n,"package.json"),r=await wi(s);o==="file"&&Object.keys(le).length>0?(wt(s,{...r,typesVersions:or({...r.typesVersions,[a]:le})},{detectIndent:!0}),e.info({message:'Your package.json "typesVersions" field has been updated.',prefix:"plugin:packem:node10-compatibility"})):Object.keys(le).length>0&&e.info({message:`Please add the following field into your package.json to enable node 10 compatibility:
|
|
78
78
|
|
|
79
79
|
${JSON.stringify({typesVersions:{"*":le}},null,4)}
|
|
80
|
-
`,prefix:"plugin:packem:node10-compatibility"})},"writeBundle")}},"node10CompatibilityPlugin");var
|
|
80
|
+
`,prefix:"plugin:packem:node10-compatibility"})},"writeBundle")}},"node10CompatibilityPlugin");var sr=Object.defineProperty,lt=g((e,t)=>sr(e,"name",{value:t,configurable:!0}),"i$c");let ti;const rr=new Map,lr=lt((e,t,i,n)=>{const{ignoreSideEffectsForRoot:o,...a}=e;let s=ti;return s||(s=ti=new Ni({...a,roots:[...a.roots??[],t],tsconfig:n?{configFile:n,references:"auto"}:void 0})),{name:"oxc-resolve",resolveId:{async handler(r,p,{isEntry:l}){const c=l||!p?_(r):_(p),{error:u,path:d}=await s.async(c,r);if(u)return i.debug(u,{context:[{basedir:t,extensions:a.extensions,id:d}]}),null;let m=lt(h=>!1,"hasModuleSideEffects");try{const{packageJson:h,path:x}=await bo(_(d),{cache:rr}),f=_(x);if(!o||t!==f){const k=h.sideEffects;if(typeof k=="boolean")m=lt(()=>k,"hasModuleSideEffects");else if(Array.isArray(k)){const b=k.map(y=>y.includes("/")?y:`**/${y}`);m=Y(b,null,{resolve:f})}}}catch(h){console.debug(h.message,{context:[{basedir:c,caller:"Resolver",error:h,extensions:a.extensions,id:d}]})}const v=await this.resolve(d,p,{skipSelf:!0});return v?v.external?!1:v.id!==d?v:{id:d,meta:v.meta,moduleSideEffects:m(d)}:null},order:"post"}}},"oxcResolvePlugin");var pr=Object.defineProperty,cr=g((e,t)=>pr(e,"name",{value:t,configurable:!0}),"t$a");const ne=cr(e=>ko("sha256").update(e).digest("hex"),"getHash");var dr=Object.defineProperty,Qi=g((e,t)=>dr(e,"name",{value:t,configurable:!0}),"d$b");const we=Qi(e=>e.handler||e,"getHandler"),q=Qi((e,t,i="")=>({...e,async buildEnd(n){e.buildEnd&&await we(e.buildEnd).call(this,n)},async buildStart(n){e.buildStart&&await we(e.buildStart).call(this,n)},async load(n){if(!e.load)return null;const o=$(i,e.name),a=$("load",ne(n));if(t.has(a,o))return await t.get(a,o);const s=await we(e.load).call(this,n);return t.set(a,s,o),s},name:`cached(${e.name})`,async resolveId(n,o,a){if(!e.resolveId)return null;const s=$(i,e.name),r=$("resolveId",ne(n),o?ne(o):"",ne(JSON.stringify(a)));if(t.has(r,s))return await t.get(r,s);const p=await we(e.resolveId).call(this,n,o,a);return t.set(r,p,s),p},async transform(n,o){if(!e.transform)return null;const a=$(i,e.name),s=$("transform",ne(o),ne(n));if(t.has(s,a))return await t.get(s,a);const r=await we(e.transform).call(this,n,o);return t.set(s,r,a),r}}),"cachingPlugin");var ur=Object.defineProperty,mr=g((e,t)=>ur(e,"name",{value:t,configurable:!0}),"c$e");const fr=mr(({directiveRegex:e,exclude:t=[],include:i=[],logger:n})=>{const o={},a={},s=Y(i,t);return{name:"packem:preserve-directives",onLog(r,p){return p.code==="MODULE_LEVEL_DIRECTIVE"&&r==="warn"?!1:null},renderChunk:{handler(r,p,{sourcemap:l}){const c=p.moduleIds.map(m=>o[m]?o[m]:null).reduce((m,v)=>(v&&v.forEach(h=>{m.add(h)}),m),new Set),u=new ee(r);c.size>0&&(n.debug({message:`directives for chunk "${p.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),u.prepend(`${[...c].map(m=>`'${m}';`).join(`
|
|
81
81
|
`)}
|
|
82
82
|
`));let d;return p.facadeModuleId&&typeof a[p.facadeModuleId]=="string"&&(d=a[p.facadeModuleId]),d&&(n.debug({message:`shebang for chunk "${p.fileName}" is preserved.`,prefix:"plugin:preserve-directives"}),u.prepend(`${d}
|
|
83
|
-
`)),c.size===0&&d===void 0?null:{code:u.toString(),map:l?u.generateMap({hires:!0}):null}},order:"post"},transform(r,p){if(!s(p))return null;let l=!1;const c=new ee(r);if(r.startsWith("#")&&r[1]==="!"){let d=0;for(let m=2,v=r.length;m<v;m++){const h=r.codePointAt(m);if(h===10||h===13||h===8232||h===8233){d=m;break}}d&&(a[p]=r.slice(0,d),c.remove(0,d+1),l=!0,n.debug({message:`shebang for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}let u=null;try{u=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${p}" and extract the directives.`}),n.warn(d),null}if(u.type!=="Program")return null;for(const d of u.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let m=null;"directive"in d?m=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(m=d.expression.value),m!=="use strict"&&m&&(o[p]||=new Set,o[p].add(m),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),l=!0),n.debug({message:`directive "${m}" for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return l?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...o[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var
|
|
83
|
+
`)),c.size===0&&d===void 0?null:{code:u.toString(),map:l?u.generateMap({hires:!0}):null}},order:"post"},transform(r,p){if(!s(p))return null;let l=!1;const c=new ee(r);if(r.startsWith("#")&&r[1]==="!"){let d=0;for(let m=2,v=r.length;m<v;m++){const h=r.codePointAt(m);if(h===10||h===13||h===8232||h===8233){d=m;break}}d&&(a[p]=r.slice(0,d),c.remove(0,d+1),l=!0,n.debug({message:`shebang for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}let u=null;try{u=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${p}" and extract the directives.`}),n.warn(d),null}if(u.type!=="Program")return null;for(const d of u.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let m=null;"directive"in d?m=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(m=d.expression.value),m!=="use strict"&&m&&(o[p]||=new Set,o[p].add(m),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),l=!0),n.debug({message:`directive "${m}" for module "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return l?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...o[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var gr=Object.defineProperty,hr=g((e,t)=>gr(e,"name",{value:t,configurable:!0}),"n$7");const vr=hr(e=>{const t=Y(e.include,e.exclude);return{async load(i){return i.includes("?raw")?await this.load({id:i.replace(/\?raw$/,"")}):null},name:"packem:raw",transform(i,n){return!t(n)&&!n.includes("?raw")?null:(n.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var xr=Object.defineProperty,yr=g((e,t)=>xr(e,"name",{value:t,configurable:!0}),"i$a");const Ze=yr((e,t)=>{let i={};return e.name&&(i[e.name]=t.rootDir),i={...i,...t.alias},t.rollup.alias&&(Array.isArray(t.rollup.alias.entries)?Object.assign(i,Object.fromEntries(t.rollup.alias.entries.map(n=>[n.find,n.replacement]))):Object.assign(i,t.rollup.alias.entries??t.rollup.alias)),i},"resolveAliases");var br=Object.defineProperty,fe=g((e,t)=>br(e,"name",{value:t,configurable:!0}),"p$5");const ii=fe((e,t,i)=>e.reduce((n,o,a)=>(o instanceof RegExp?n.push(o):typeof o=="string"&&o.length>0?n.push(new RegExp("^"+o.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$")):i.warn(`Ignoring wrong entry type #${a} in '${t}' option: ${JSON.stringify(o)}`),n),[]),"getRegExps"),ni=new Map,wr=fe((e,t)=>{ni.has(e)||t.info({message:'Inlined implicit external "'+D(e)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),ni.set(e,!0)},"logExternalMessage"),oi=new Set(["node:test","node:sqlite"]),Zi=fe((e,t,i,n,o)=>{const a=new Map,s=new Map,r=new Set(ii([...i.externals],"include",n)),p=new Set(ii([...o.exclude??[]],"exclude",n)),l={};Object.assign(l,o.deps?e.dependencies:void 0,o.devDeps?e.devDependencies:void 0,o.peerDeps?e.peerDependencies:void 0,o.optDeps?e.optionalDependencies:void 0);const c=Object.keys(l);if(c.length>0&&r.add(new RegExp("^(?:"+c.join("|")+")(?:/.+)?$")),e.peerDependenciesMeta)for(const[h,x]of Object.entries(e.peerDependenciesMeta))x?.optional&&r.add(new RegExp(`^${h}(?:/.+)?$`));const u=fe(h=>[...r].some(x=>x.test(h)),"isIncluded"),d=fe(h=>[...p].some(x=>x.test(h)),"isExcluded");let m=[];t&&(m=Object.entries(t.config.compilerOptions?.paths??{}).map(([h])=>h.endsWith("*")?new RegExp(`^${h.replace("*","(.*)")}$`):new RegExp(`^${h}$`)));const v=Ze(e,i);return{name:"packem:resolve-externals",options:fe(h=>{h.external=(x,f)=>{if(s.has(x))return s.get(x);let k;Object.keys(v).length>0&&(k=po(x,v),k===x&&(k=void 0));for(const b of[x,k].filter(Boolean)){if(/^(?:\0|\.{1,2}\/)/.test(b)||Ce(b)||new RegExp(`${i.sourceDir}[/.*|\\.*]`).test(b)||e.name&&b.startsWith(e.name))return s.set(b,!1),!1;if(at(b)||oi.has(b)){let y=o.builtins;return y===void 0&&f&&(y=u(f)&&!d(f)),s.set(b,y),y}if(b[0]==="#"&&e.imports)for(const[y,j]of Object.entries(e.imports)){if(y[0]!=="#"){n.debug({message:'Ignoring package.json import "'+D(y)+'" because it does not start with "#".',prefix:"plugin:packem:resolve-externals"});continue}if(y===b)return s.set(b,!1),!1;if(y.includes("*")){let w;a.has(y)?w=a.get(y):(w=jo($(i.rootDir,j.replace("/*","")),{withFileTypes:!0}).filter(S=>S.isFile()).map(S=>S.name),a.set(y,w));for(const S of w)if(S.replace(se,"")===b.replace(se,"").replace("#",""))return s.set(b,!1),!1}}if(m.length>0){for(const y of m)if(y.test(b))return s.set(b,!1),!1}if(u(b)&&!d(b))return s.set(b,!0),!0}return wr(x,n),!1}},"options"),resolveId:{async handler(h,x,{isEntry:f}){if(f)return null;if(oi.has(h))return{external:!0,id:h,moduleSideEffects:!1};if(at(h)){const k=h.replace(/^node:/,"");return{external:(o.builtins||u(h))&&!d(h),id:o.builtinsPrefix==="ignore"?h:o.builtinsPrefix==="add"||!at(k)?"node:"+k:k,moduleSideEffects:!1}}return null},order:"pre"}}},"resolveExternalsPlugin");var kr=Object.defineProperty,jr=g((e,t)=>kr(e,"name",{value:t,configurable:!0}),"r$9");const en=jr(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return Ci(e)}}),"resolveFileUrl");var $r=Object.defineProperty,et=g((e,t)=>$r(e,"name",{value:t,configurable:!0}),"i$8");const We=/^#![^\n]*/,yt=et(async e=>{await Gn(e,493).catch(()=>{})},"makeExecutable"),Er=et((e,t)=>({name:"packem:shebang",renderChunk:{handler(i,n,o){if(!n.isEntry||!n.facadeModuleId)return null;const a=i.startsWith("#")&&i[1]==="!";if(a&&t.replace)return i.replace(We,t.shebang+`
|
|
84
84
|
`);if(a)return null;if(e.includes(n.name)){const s=new ee(i);return s.prepend(t.shebang+`
|
|
85
|
-
`),{code:s.toString(),map:o.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(i,n){for(const[o,a]of Object.entries(n))if(a.type==="chunk"&&We.test(a.code)&&i.dir){const s=P(i.dir,o);await yt(s)}}}),"shebangPlugin"),
|
|
86
|
-
`)=>{const i=We.exec(e);return i?i+t:""},"getShebang");var
|
|
85
|
+
`),{code:s.toString(),map:o.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(i,n){for(const[o,a]of Object.entries(n))if(a.type==="chunk"&&We.test(a.code)&&i.dir){const s=P(i.dir,o);await yt(s)}}}),"shebangPlugin"),Sr=et(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(We,"")}}),"removeShebangPlugin"),Or=et((e,t=`
|
|
86
|
+
`)=>{const i=We.exec(e);return i?i+t:""},"getShebang");var Pr=Object.defineProperty,Dr=g((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"l$9");const Cr=Dr(({exclude:e,include:t}={})=>{const i=Y(t,e);return{async load(n){if(!i(n))return null;let o;try{o=await De(n,{buffer:!1}),this.addWatchFile(n)}catch{try{const s=n.replace(/\?.*$/,"");o=await De(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=So(n);if(s===void 0)return o;a=s}catch{return this.warn("Failed resolving source map"),{code:o}}return{code:o,map:a}},name:"packem:sourcemaps"}},"sourcemapsPlugin");var Nr=Object.defineProperty,de=g((e,t)=>Nr(e,"name",{value:t,configurable:!0}),"r$8");const Mr=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,_r=/MIT License|MIT license|BSD license/,Tr=/\n{2,}/g,Ir=/\b(\w+)\$\d+\b/g,zr=/[-/\\^$*+?.()|[\]{}]/g,Ar=de(e=>e.replaceAll(zr,"\\$&"),"escapeRegex"),Rr=de(e=>[...new Set(e)],"unique"),Fr=de(e=>e.replaceAll(Mr,t=>_r.test(t)?"":t).replaceAll(Tr,`
|
|
87
87
|
|
|
88
|
-
`),"cleanUnnecessaryComments"),
|
|
89
|
-
- ${p}`).join(""),r=t.fileName.replace(/\.[^/.]+$/,"");
|
|
88
|
+
`),"cleanUnnecessaryComments"),ai=new Map;function tn(e,t,{identifierReplacements:i},n){const o=Di(e);for(const s in i){const r=o.find(l=>l.specifier===s&&l.imports.includes("{"));if(!r){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const p=i[s];for(const l in p){if(!r.imports.includes(l))throw new Error(`${t.fileName} does not import "${l}" from "${s}" for replacement`);const c=p[l],u=Ar(l);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${u},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${u}\\b`,"g"),c)}}const a=Rr(Array.from(e.matchAll(Ir),s=>s[0]));if(a.length>0){const s=a.map(p=>`
|
|
89
|
+
- ${p}`).join(""),r=t.fileName.replace(/\.[^/.]+$/,"");ai.has(r)||n.warn({message:`${t.fileName} contains confusing identifier names${s}
|
|
90
90
|
|
|
91
|
-
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),oi.set(r,!0)}return e}g(tn,"I$1");de(tn,"replaceConfusingTypeNames");const Jr=de((e,t)=>{if(t.leadingComments?.some(i=>i.type==="CommentBlock"&&i.value.includes("@internal"))){const i=e.original[t.end]===","?t.end+1:t.end;return e.remove(t.leadingComments[0].start,i),!0}return!1},"removeInternal");function nn(e,t){if(e.includes("@internal")){const i=new ee(e),n=Po(e,{plugins:["typescript"],sourceType:"module"});if(St(n,{enter(o){Jr(i,o)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}g(nn,"S$3");de(nn,"stripInternalTypes");const Br=de((e,t)=>({name:"packem:patch-types",renderChunk(i,n){return i=tn.call(this,i,n,e,t),i=nn.call(this,i,n),i=Lr(i),i}}),"patchTypescriptTypes");var qr=Object.defineProperty,te=g((e,t)=>qr(e,"name",{value:t,configurable:!0}),"a$i");const Wr=42,Ur=te(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===Wr){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),Vr=te(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),Kr=te(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),Gr=te((e,t,i)=>{let n,o=-1;for(const a of e){const s=t(a);Kr(s,i)&&s.prefix.length>o&&(o=s.prefix.length,n=a)}return n},"findBestPatternMatch"),Hr=te((e,t)=>{const i=[];for(const n of e){if(!Ur(n))continue;const o=Vr(n);if(o)i.push(o);else if(n===t)return n}return Gr(i,n=>n,t)},"matchPatternOrExact"),Yr=te((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),Xr=te(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),Qr=te((e,t,i)=>{let n=_(t.path);t.config.compilerOptions?.baseUrl&&(n=P(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${n}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const o=t.config.compilerOptions?.paths??{};return Object.keys(o).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:o,resolvedBaseUrl:n}},"getTsconfigPaths"),on=te((e,t,i,n)=>{const{paths:o,resolvedBaseUrl:a}=Qr(e,t,i),s=Object.keys(o);return{name:"packem:resolve-tsconfig-paths",async resolveId(r,p,l){if(s.length===0)return null;if(r.includes("\0"))return i.debug({message:`Skipping resolution of ${r} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(r.includes("node_modules"))return i.debug({message:`Skipping request as it is inside node_modules ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(!n.resolveAbsolutePath&&Ce(r))return i.debug({message:`Skipping request as it is an absolute path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(kt(r))return i.debug({message:`Skipping request as it is a relative path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=Hr(s,r);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const u=typeof c=="string"?void 0:Yr(c,r),d=typeof c=="string"?c:Xr(c);for await(const m of o[d]){const v=u?m.replace("*",u):m;if(v.endsWith(".d.ts")||v.endsWith(".d.cts")||v.endsWith(".d.mts"))continue;const h=$(a,v);try{const x=await this.resolve(h,p,{skipSelf:!0,...l});if(x)return x}catch(x){i.debug({context:[x],message:`Failed to resolve ${h} from ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var Zr=Object.defineProperty,an=g((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"u$7");const el=an((e,t)=>{if(!t)return null;const{config:i,path:n}=t;if(!i.compilerOptions)return null;const{rootDirs:o}=i.compilerOptions;if(!o)return null;const a=[];for(const s of o){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${n}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${n}.`);a.push(P(e,s))}return a},"getRootDirectories"),sn=an((e,t,i)=>{const n=el(e,i);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(o,a,s){if(n===null||n.length===0)return null;if(o.startsWith("."))for(const r of n){const p=$(r,o),l=await this.resolve(p,a,{skipSelf:!0,...s});if(l)return t.debug({message:`Resolved ${o} to ${l.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),l.id}return null}}},"resolveTsconfigRootDirectories");var tl=Object.defineProperty,il=g((e,t)=>tl(e,"name",{value:t,configurable:!0}),"r$7");const nl=il(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,i,n){return e.test(t)&&i?await this.resolve(t.replace(/js(x?)$/,"ts$1"),i,n):null}}},"resolveTypescriptMjsCts"),rn={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(rn);const ln={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(ln);var ol=Object.defineProperty,al=g((e,t)=>ol(e,"name",{value:t,configurable:!0}),"g$5"),B=g(function(e,t,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(e):n?n.value:t.get(e)},"n$5"),me,Oe,pe;let sl=class{static{g(this,"p")}static{al(this,"Mime")}constructor(...t){me.set(this,new Map),Oe.set(this,new Map),pe.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[n,o]of Object.entries(t)){n=n.toLowerCase(),o=o.map(r=>r.toLowerCase()),B(this,pe,"f").has(n)||B(this,pe,"f").set(n,new Set);const a=B(this,pe,"f").get(n);let s=!0;for(let r of o){const p=r.startsWith("*");if(r=p?r.slice(1):r,a?.add(r),s&&B(this,Oe,"f").set(n,r),s=!1,p)continue;const l=B(this,me,"f").get(r);if(l&&l!=n&&!i)throw new Error(`"${n} -> ${r}" conflicts with "${l} -> ${r}". Pass \`force=true\` to override this definition.`);B(this,me,"f").set(r,n)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),n=i.replace(/^.*\./,"").toLowerCase(),o=i.length<t.length;return!(n.length<i.length-1)&&o?null:B(this,me,"f").get(n)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&B(this,Oe,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:B(this,pe,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of B(this,pe,"f").values())Object.freeze(t);return this}_getTestState(){return{types:B(this,me,"f"),extensions:B(this,Oe,"f")}}};me=new WeakMap,Oe=new WeakMap,pe=new WeakMap;const rl=new sl(ln,rn)._freeze();var ll=Object.defineProperty,Ot=g((e,t)=>ll(e,"name",{value:t,configurable:!0}),"u$6");const pl=Ot(async(e,t)=>{await new Promise((i,n)=>{const o=jt(e);o.on("error",n);const a=Eo(t);a.on("error",n),a.on("finish",i),o.pipe(a)})},"copy"),cl=Ot(e=>{let t=e.toString("utf8").replaceAll(/[\n\r]/g,"").replaceAll(" "," "),i;do i=t,t=t.replaceAll(/<!--(.*(?=-->))-->/g,"");while(t!==i);return encodeURIComponent(t.replaceAll("'","\\i")).replaceAll("(","%28").replaceAll(")","%29")},"encodeSVG"),dl=Ot(({destDir:e,emitFiles:t,exclude:i,fileName:n,include:o,limit:a,publicPath:s,sourceDir:r})=>{const p=Y(o,i),l={};return{async generateBundle(c){if(!t)return;const u=e??c.dir??_(c.file??"");await Nt(u),await Promise.all(Object.keys(l).map(async d=>{const m=l[d],v=$(u,_(m));await Nt(v),await pl(d,$(u,m))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[u,d]=await Promise.all([wt(c),Yn(c)]);let m;if(a&&u.size>a||a===0){const v=ko.createHash("sha1").update(d).digest("hex").slice(0,16),h=Ne(c),x=H(c,h),f=r?I(r,_(c)):H(_(c)),k=n.replaceAll("[hash]",v).replaceAll("[extname]",h).replaceAll("[dirname]",f===""?"":`${f}/`).replaceAll("[name]",x);m=$(s??"",k),l[c]=k}else{const v=rl.getType(c);if(v===null)throw new Error(`Could not determine mimetype for ${c}`);const h=v==="image/svg+xml";m=h?cl(d):d.toString("base64"),m=`data:${v}${h?"":";base64"},${m}`}return`export default "${m}"`},name:"packem:url"}},"urlPlugin");var ul=Object.defineProperty,ml=g((e,t)=>ul(e,"name",{value:t,configurable:!0}),"s$b");const fl=ml(e=>{const t=H(e).split(".");if(t.length>=2){const[i,n]=t.slice(-2),o=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Ye.includes(n)&&a&&a.length>0)return o+"-"+a}},"getCustomModuleLayer");var gl=Object.defineProperty,hl=g((e,t)=>gl(e,"name",{value:t,configurable:!0}),"i$6");const pt=hl(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var vl=Object.defineProperty,ai=g((e,t)=>vl(e,"name",{value:t,configurable:!0}),"d$a");const xl=ai((e,t)=>{const i=new Map;return ai(function(n,o){const a=o.getModuleInfo(n);if(!a)return;const{isEntry:s}=a,r=a.meta,p=pt(r);if(!s){const l=i.get(n);if(l)return l;const c=fl(n);if(c)return i.set(n,c),c}if(s){const l=o.getModuleIds();for(const c of l)o.getModuleInfo(c)&&pt(r)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([n,p]))}if(p&&!s&&e.has(n)){const l=[...e.get(n)];if(l.some(([u])=>{if(t.some(d=>d.path===u)){const d=o.getModuleInfo(u);return pt(d?d.meta:{})===p}return!1}))return;if(l.every(([,u])=>u===p))return i.has(n)?i.get(n):void 0;const c=H(n,Ne(n))+"-"+p;return i.set(n,c),c}},"splitChunks")},"createSplitChunks");var yl=Object.defineProperty,bl=g((e,t)=>yl(e,"name",{value:t,configurable:!0}),"n$4");const ae=bl((e,t)=>e.isDynamicEntry?`${qo}/[name].${t}`:`${Wo}/${e.name}-[hash].${t}`,"getChunkFilename");var wl=Object.defineProperty,kl=g((e,t)=>wl(e,"name",{value:t,configurable:!0}),"o$3");const jl=process.platform==="win32",si=kl((e,t)=>{const i=jl?"\\":"/";for(let n of Array.isArray(e.names)?e.names:[]){if(n.includes("node_modules"+i+".pnpm"))return n=n.replace("node_modules"+i+".pnpm","external")+"."+t,n.replace("node_modules"+i,"");if(n.includes("node_modules"))return n.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var $l=Object.defineProperty,El=g((e,t)=>$l(e,"name",{value:t,configurable:!0}),"t$5");const pn=El((e,t)=>{const i=[],n=[],o=[];return e&&e.filter(Boolean).filter(a=>a.type===t?!0:t==="build"&&a.type===void 0).forEach(a=>{a.enforce==="pre"?i.push(a.plugin):a.enforce==="post"?n.push(a.plugin):o.push(a.plugin)}),[i,o,n]},"sortUserPlugins");var Sl=Object.defineProperty,F=g((e,t)=>Sl(e,"name",{value:t,configurable:!0}),"e$6");const Ol=F((e,t)=>{let i="node"+On.node.split(".")[0];if(t.pkg.engines?.node){const n=Pi(t.pkg.engines.node);n&&(i="node"+n.major)}if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");if(t.tsconfig?.config.compilerOptions?.target?.toLowerCase()==="es3"&&(t.logger.warn(["ES3 target is not supported by esbuild, so ES5 will be used instead..","Please set 'target' option in tsconfig to at least ES5 to disable this error"].join(" ")),t.tsconfig.config.compilerOptions.target="es5",t.options.rollup.esbuild.target="es5"),t.options.rollup.esbuild.target){const n=mt(t.options.rollup.esbuild.target);t.options.runtime==="node"?t.options.rollup.esbuild.target=[...new Set([i,...n])]:t.options.runtime==="browser"&&(t.options.rollup.esbuild.target=[...new Set([...Kt(t.options.browserTargets??[]),...n])])}else t.options.rollup.esbuild.target=t.options.runtime==="node"?[i]:Kt(t.options.browserTargets??[]);return t.tsconfig?.config.compilerOptions?.target==="es5"&&(t.options.rollup.esbuild.keepNames=!1,t.logger.debug("Disabling keepNames because target is set to es5")),{logger:t.logger,minify:t.options.minify,minifyWhitespace:t.options.minify,sourceMap:t.options.sourcemap,...t.options.rollup.esbuild}}if(e==="swc"){if(!t.options.rollup.swc)throw new Error("No swc options found in your configuration.");return{minify:t.options.minify,...t.options.rollup.swc,jsc:{minify:{compress:{directives:!1},format:{comments:"some"},mangle:{topLevel:!0},sourceMap:t.options.sourcemap,toplevel:t.options.emitCJS??t.options.emitESM},...t.options.rollup.swc.jsc},sourceMaps:t.options.sourcemap}}if(e==="sucrase"){if(!t.options.rollup.sucrase)throw new Error("No sucrase options found in your configuration.");return t.options.rollup.sucrase}throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),cn=F((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&/Circular dependency:[\s\S]*node_modules/.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT")throw new Error(`Failed to resolve the module "${e.exporter}" imported by "${D(I(P(),e.id))}"
|
|
91
|
+
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),ai.set(r,!0)}return e}g(tn,"I$1");de(tn,"replaceConfusingTypeNames");const Lr=de((e,t)=>{if(t.leadingComments?.some(i=>i.type==="CommentBlock"&&i.value.includes("@internal"))){const i=e.original[t.end]===","?t.end+1:t.end;return e.remove(t.leadingComments[0].start,i),!0}return!1},"removeInternal");function nn(e,t){if(e.includes("@internal")){const i=new ee(e),n=Oo(e,{plugins:["typescript"],sourceType:"module"});if(Ot(n,{enter(o){Lr(i,o)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}g(nn,"S$3");de(nn,"stripInternalTypes");const Br=de((e,t)=>({name:"packem:patch-types",renderChunk(i,n){return i=tn.call(this,i,n,e,t),i=nn.call(this,i,n),i=Fr(i),i}}),"patchTypescriptTypes");var Jr=Object.defineProperty,te=g((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"a$i");const qr=42,Wr=te(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===qr){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),Ur=te(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),Vr=te(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),Kr=te((e,t,i)=>{let n,o=-1;for(const a of e){const s=t(a);Vr(s,i)&&s.prefix.length>o&&(o=s.prefix.length,n=a)}return n},"findBestPatternMatch"),Gr=te((e,t)=>{const i=[];for(const n of e){if(!Wr(n))continue;const o=Ur(n);if(o)i.push(o);else if(n===t)return n}return Kr(i,n=>n,t)},"matchPatternOrExact"),Hr=te((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),Yr=te(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),Xr=te((e,t,i)=>{let n=_(t.path);t.config.compilerOptions?.baseUrl&&(n=P(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${n}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const o=t.config.compilerOptions?.paths??{};return Object.keys(o).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:o,resolvedBaseUrl:n}},"getTsconfigPaths"),on=te((e,t,i,n)=>{const{paths:o,resolvedBaseUrl:a}=Xr(e,t,i),s=Object.keys(o);return{name:"packem:resolve-tsconfig-paths",async resolveId(r,p,l){if(s.length===0)return null;if(r.includes("\0"))return i.debug({message:`Skipping resolution of ${r} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(r.includes("node_modules"))return i.debug({message:`Skipping request as it is inside node_modules ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(!n.resolveAbsolutePath&&Ce(r))return i.debug({message:`Skipping request as it is an absolute path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(jt(r))return i.debug({message:`Skipping request as it is a relative path ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=Gr(s,r);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const u=typeof c=="string"?void 0:Hr(c,r),d=typeof c=="string"?c:Yr(c);for await(const m of o[d]){const v=u?m.replace("*",u):m;if(v.endsWith(".d.ts")||v.endsWith(".d.cts")||v.endsWith(".d.mts"))continue;const h=$(a,v);try{const x=await this.resolve(h,p,{skipSelf:!0,...l});if(x)return x}catch(x){i.debug({context:[x],message:`Failed to resolve ${h} from ${r}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var Qr=Object.defineProperty,an=g((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"u$7");const Zr=an((e,t)=>{if(!t)return null;const{config:i,path:n}=t;if(!i.compilerOptions)return null;const{rootDirs:o}=i.compilerOptions;if(!o)return null;const a=[];for(const s of o){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${n}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${n}.`);a.push(P(e,s))}return a},"getRootDirectories"),sn=an((e,t,i)=>{const n=Zr(e,i);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(o,a,s){if(n===null||n.length===0)return null;if(o.startsWith("."))for(const r of n){const p=$(r,o),l=await this.resolve(p,a,{skipSelf:!0,...s});if(l)return t.debug({message:`Resolved ${o} to ${l.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),l.id}return null}}},"resolveTsconfigRootDirectories");var el=Object.defineProperty,tl=g((e,t)=>el(e,"name",{value:t,configurable:!0}),"r$7");const il=tl(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,i,n){return e.test(t)&&i?await this.resolve(t.replace(/js(x?)$/,"ts$1"),i,n):null}}},"resolveTypescriptMjsCts"),rn={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(rn);const ln={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(ln);var nl=Object.defineProperty,ol=g((e,t)=>nl(e,"name",{value:t,configurable:!0}),"g$5"),J=g(function(e,t,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(e):n?n.value:t.get(e)},"n$5"),me,Oe,pe;let al=class{static{g(this,"p")}static{ol(this,"Mime")}constructor(...t){me.set(this,new Map),Oe.set(this,new Map),pe.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[n,o]of Object.entries(t)){n=n.toLowerCase(),o=o.map(r=>r.toLowerCase()),J(this,pe,"f").has(n)||J(this,pe,"f").set(n,new Set);const a=J(this,pe,"f").get(n);let s=!0;for(let r of o){const p=r.startsWith("*");if(r=p?r.slice(1):r,a?.add(r),s&&J(this,Oe,"f").set(n,r),s=!1,p)continue;const l=J(this,me,"f").get(r);if(l&&l!=n&&!i)throw new Error(`"${n} -> ${r}" conflicts with "${l} -> ${r}". Pass \`force=true\` to override this definition.`);J(this,me,"f").set(r,n)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),n=i.replace(/^.*\./,"").toLowerCase(),o=i.length<t.length;return!(n.length<i.length-1)&&o?null:J(this,me,"f").get(n)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&J(this,Oe,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:J(this,pe,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of J(this,pe,"f").values())Object.freeze(t);return this}_getTestState(){return{types:J(this,me,"f"),extensions:J(this,Oe,"f")}}};me=new WeakMap,Oe=new WeakMap,pe=new WeakMap;const sl=new al(ln,rn)._freeze();var rl=Object.defineProperty,Pt=g((e,t)=>rl(e,"name",{value:t,configurable:!0}),"u$6");const ll=Pt(async(e,t)=>{await new Promise((i,n)=>{const o=$t(e);o.on("error",n);const a=$o(t);a.on("error",n),a.on("finish",i),o.pipe(a)})},"copy"),pl=Pt(e=>{let t=e.toString("utf8").replaceAll(/[\n\r]/g,"").replaceAll(" "," "),i;do i=t,t=t.replaceAll(/<!--(.*(?=-->))-->/g,"");while(t!==i);return encodeURIComponent(t.replaceAll("'","\\i")).replaceAll("(","%28").replaceAll(")","%29")},"encodeSVG"),cl=Pt(({destDir:e,emitFiles:t,exclude:i,fileName:n,include:o,limit:a,publicPath:s,sourceDir:r})=>{const p=Y(o,i),l={};return{async generateBundle(c){if(!t)return;const u=e??c.dir??_(c.file??"");await Mt(u),await Promise.all(Object.keys(l).map(async d=>{const m=l[d],v=$(u,_(m));await Mt(v),await ll(d,$(u,m))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[u,d]=await Promise.all([kt(c),Hn(c)]);let m;if(a&&u.size>a||a===0){const v=wo.createHash("sha1").update(d).digest("hex").slice(0,16),h=Ne(c),x=H(c,h),f=r?I(r,_(c)):H(_(c)),k=n.replaceAll("[hash]",v).replaceAll("[extname]",h).replaceAll("[dirname]",f===""?"":`${f}/`).replaceAll("[name]",x);m=$(s??"",k),l[c]=k}else{const v=sl.getType(c);if(v===null)throw new Error(`Could not determine mimetype for ${c}`);const h=v==="image/svg+xml";m=h?pl(d):d.toString("base64"),m=`data:${v}${h?"":";base64"},${m}`}return`export default "${m}"`},name:"packem:url"}},"urlPlugin");var dl=Object.defineProperty,ul=g((e,t)=>dl(e,"name",{value:t,configurable:!0}),"s$b");const ml=ul(e=>{const t=H(e).split(".");if(t.length>=2){const[i,n]=t.slice(-2),o=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Ye.includes(n)&&a&&a.length>0)return o+"-"+a}},"getCustomModuleLayer");var fl=Object.defineProperty,gl=g((e,t)=>fl(e,"name",{value:t,configurable:!0}),"i$6");const pt=gl(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var hl=Object.defineProperty,si=g((e,t)=>hl(e,"name",{value:t,configurable:!0}),"d$a");const vl=si((e,t)=>{const i=new Map;return si(function(n,o){const a=o.getModuleInfo(n);if(!a)return;const{isEntry:s}=a,r=a.meta,p=pt(r);if(!s){const l=i.get(n);if(l)return l;const c=ml(n);if(c)return i.set(n,c),c}if(s){const l=o.getModuleIds();for(const c of l)o.getModuleInfo(c)&&pt(r)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([n,p]))}if(p&&!s&&e.has(n)){const l=[...e.get(n)];if(l.some(([u])=>{if(t.some(d=>d.path===u)){const d=o.getModuleInfo(u);return pt(d?d.meta:{})===p}return!1}))return;if(l.every(([,u])=>u===p))return i.has(n)?i.get(n):void 0;const c=H(n,Ne(n))+"-"+p;return i.set(n,c),c}},"splitChunks")},"createSplitChunks");var xl=Object.defineProperty,yl=g((e,t)=>xl(e,"name",{value:t,configurable:!0}),"n$4");const ae=yl((e,t)=>e.isDynamicEntry?`${Jo}/[name].${t}`:`${qo}/${e.name}-[hash].${t}`,"getChunkFilename");var bl=Object.defineProperty,wl=g((e,t)=>bl(e,"name",{value:t,configurable:!0}),"o$3");const kl=process.platform==="win32",ri=wl((e,t)=>{const i=kl?"\\":"/";for(let n of Array.isArray(e.names)?e.names:[]){if(n.includes("node_modules"+i+".pnpm"))return n=n.replace("node_modules"+i+".pnpm","external")+"."+t,n.replace("node_modules"+i,"");if(n.includes("node_modules"))return n.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var jl=Object.defineProperty,$l=g((e,t)=>jl(e,"name",{value:t,configurable:!0}),"t$5");const pn=$l((e,t)=>{const i=[],n=[],o=[];return e&&e.filter(Boolean).filter(a=>a.type===t?!0:t==="build"&&a.type===void 0).forEach(a=>{a.enforce==="pre"?i.push(a.plugin):a.enforce==="post"?n.push(a.plugin):o.push(a.plugin)}),[i,o,n]},"sortUserPlugins");var El=Object.defineProperty,F=g((e,t)=>El(e,"name",{value:t,configurable:!0}),"e$6");const Sl=F((e,t)=>{let i="node"+On.node.split(".")[0];if(t.pkg.engines?.node){const n=Pi(t.pkg.engines.node);n&&(i="node"+n.major)}if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");if(t.tsconfig?.config.compilerOptions?.target?.toLowerCase()==="es3"&&(t.logger.warn(["ES3 target is not supported by esbuild, so ES5 will be used instead..","Please set 'target' option in tsconfig to at least ES5 to disable this error"].join(" ")),t.tsconfig.config.compilerOptions.target="es5",t.options.rollup.esbuild.target="es5"),t.options.rollup.esbuild.target){const n=mt(t.options.rollup.esbuild.target);t.options.runtime==="node"?t.options.rollup.esbuild.target=[...new Set([i,...n])]:t.options.runtime==="browser"&&(t.options.rollup.esbuild.target=[...new Set([...Gt(t.options.browserTargets??[]),...n])])}else t.options.rollup.esbuild.target=t.options.runtime==="node"?[i]:Gt(t.options.browserTargets??[]);return t.tsconfig?.config.compilerOptions?.target==="es5"&&(t.options.rollup.esbuild.keepNames=!1,t.logger.debug("Disabling keepNames because target is set to es5")),{logger:t.logger,minify:t.options.minify,minifyWhitespace:t.options.minify,sourceMap:t.options.sourcemap,...t.options.rollup.esbuild}}if(e==="swc"){if(!t.options.rollup.swc)throw new Error("No swc options found in your configuration.");return{minify:t.options.minify,...t.options.rollup.swc,jsc:{minify:{compress:{directives:!1},format:{comments:"some"},mangle:{topLevel:!0},sourceMap:t.options.sourcemap,toplevel:t.options.emitCJS??t.options.emitESM},...t.options.rollup.swc.jsc},sourceMaps:t.options.sourcemap}}if(e==="sucrase"){if(!t.options.rollup.sucrase)throw new Error("No sucrase options found in your configuration.");return t.options.rollup.sucrase}throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),cn=F((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&/Circular dependency:[\s\S]*node_modules/.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT")throw new Error(`Failed to resolve the module "${e.exporter}" imported by "${D(I(P(),e.id))}"
|
|
92
92
|
Is the module installed? Note:
|
|
93
93
|
↳ to inline a module into your bundle, install it to "devDependencies".
|
|
94
94
|
↳ to depend on a module via import/require, install it to "dependencies".`);return e.code==="MODULE_LEVEL_DIRECTIVE"?!0:e.code==="MIXED_EXPORTS"&&t.options.cjsInterop===!0},"sharedOnWarn"),dn=F((e,t)=>({input:Object.fromEntries(e.options.entries.map(i=>[i.name,P(e.options.rootDir,i.input)])),logLevel:e.options.debug?"debug":"info",onLog:F((i,n)=>{let o=n.message;switch(n.stack&&(o=`${o}
|
|
95
|
-
${n.stack}`),i){case"info":{e.logger.info({message:o,prefix:t+(n.plugin?":plugin:"+n.plugin:"")});return}case"warn":{e.logger.warn({message:o,prefix:t+(n.plugin?":plugin:"+n.plugin:"")});return}case"debug":e.logger.debug({message:o,prefix:t+(n.plugin?":plugin:"+n.plugin:"")})}},"onLog"),onwarn(i,n){cn(i,e)||i.code||n(i)},treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),un=F(async(e,t)=>{const i=Ze(e.pkg,e.options);let n;e.options.rollup.resolve&&(n=Si({...e.options.rollup.resolve}));const o=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:xl(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,r]=pn(e.options.rollup.plugins,"build"),p=e.tsconfig?.config.compilerOptions?.esModuleInterop;return{...dn(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:F(l=>ae(l,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:F(l=>si(l,"cjs"),"entryFileNames"),esModule:p??"if-default-prop",exports:"auto",externalLiveBindings:!1,format:"cjs",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,interop:"compat",sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...o},e.options.emitESM&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:F(l=>ae(l,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:F(l=>si(l,"mjs"),"entryFileNames"),esModule:p??"if-default-prop",exports:"auto",externalLiveBindings:!1,format:"esm",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...o}].filter(Boolean),plugins:[q(en(),t),e.tsconfig&&q(sn(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&q(on(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),Zi(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),e.options.rollup.replace&&Oi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Ei({customResolver:n,...e.options.rollup.alias,entries:i}),...a,n,e.options.rollup.polyfillNode&&io({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&Ki({...e.options.rollup.json}),la(),e.options.rollup.wasm&&to(e.options.rollup.wasm),e.options.rollup.url&&dl(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await as({dts:!!e.options.declaration||e.options.isolatedDeclarationTransformer!==void 0,sourceMap:e.options.sourcemap,...e.options.rollup.css},e.logger,e.options.browserTargets,e.options.rootDir,e.options.sourceDir,e.environment,e.options.sourcemap,e.options.debug,e.options.minify??!1,i),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&e.options.declaration&&us(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&q(xr(e.options.rollup.raw),t),e.options.sourcemap&&Nr(e.options.rollup.sourcemap),...s,e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&As($(e.options.rootDir,e.options.sourceDir),e.options.isolatedDeclarationTransformer,e.options.declaration,!!e.options.rollup.cjsInterop,e.logger,e.options.rollup.isolatedDeclarations,e.options.sourcemap,e.tsconfig),e.options.transformer(Ol(e.options.transformerName,e)),q(gr({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&Sr(e.options.entries.filter(l=>l.executable).map(l=>l.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Ri({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&Os(),e.options.rollup.dynamicVars&&eo(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&q(Zn({sourceMap:e.options.sourcemap,...e.options.rollup.commonjs}),t),e.options.rollup.preserveDynamicImports&&{name:"packem:preserve-dynamic-imports",renderDynamicImport(){return{left:"import(",right:")"}}},e.options.cjsInterop&&e.options.rollup.shim&&$s(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&q(Hs({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...r,e.options.rollup.metafile&&nr(),e.options.rollup.copy&&va(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Xi({dtsMarker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dependenciesTemplate,logger:e.logger,marker:e.options.rollup.license.dependenciesMarker??"DEPENDENCIES",mode:"dependencies",packageName:e.pkg.name}),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&sr(e.logger,e.options.entries,e.options.outDir,e.options.rootDir,e.options.rollup.node10Compatibility.writeToPackageJson?"file":"console",e.options.rollup.node10Compatibility.typeScriptVersion??"*"),e.options.analyze&&e.options.rollup.visualizer!==!1&&no({brotliSize:!0,gzipSize:!0,projectRoot:e.options.rootDir,sourcemap:e.options.sourcemap,...e.options.rollup.visualizer,filename:"packem-bundle-analyze.html",title:"Packem Visualizer"})].filter(Boolean)}},"getRollupOptions"),Pl=F(async e=>{const{dts:t}=require("rollup-plugin-dts");return t({compilerOptions:{...e.options.rollup.dts.compilerOptions,incremental:void 0,inlineSources:void 0,sourceMap:void 0,tsBuildInfoFile:void 0},respectExternal:e.options.rollup.dts.respectExternal,tsconfig:e.tsconfig?.path})},"createDtsPlugin"),Dl=Ho(Pl),mn=F(async(e,t)=>{const i=Ze(e.pkg,e.options),n=e.tsconfig?.config.compilerOptions;delete n?.lib;let o;e.options.rollup.resolve&&e.options.experimental?.oxcResolve!==!0?o=Si({...e.options.rollup.resolve}):e.options.experimental?.oxcResolve&&e.options.rollup.experimental?.resolve&&(o=pr(e.options.rollup.experimental.resolve,e.options.rootDir,e.logger,e.tsconfig?.path));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,r,p]=pn(e.options.rollup.plugins,"dts");return{...dn(e,"dts"),onwarn(l,c){cn(l,e)||l.code!=="EMPTY_BUNDLE"&&c(l)},output:[e.options.emitCJS&&{chunkFileNames:F(l=>ae(l,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:F(l=>ae(l,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts",format:"esm",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.declaration==="compatible"&&{chunkFileNames:F(l=>ae(l,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[q(en(),t),q(nl(),t),e.options.rollup.json&&Ki({...e.options.rollup.json}),{load(l){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(l)?null:""},name:"packem:ignore-files"},e.tsconfig&&q(sn(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&q(on(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),Zi(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),e.options.rollup.replace&&Oi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Ei({customResolver:o,...e.options.rollup.alias,entries:i}),...s,o,...r,await Dl(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Ri({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&q(Br(e.options.rollup.patchTypes,e.logger),t),Or(),...p,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Xi({licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dtsTemplate,logger:e.logger,marker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",mode:"types",packageName:e.pkg.name})].filter(Boolean)}},"getRollupDtsOptions");var Cl=Object.defineProperty,Nl=g((e,t)=>Cl(e,"name",{value:t,configurable:!0}),"m$5");const ri="rollup-build.json",Ml=Nl(async(e,t,i)=>{const n=await un(e,t);if(await e.hooks.callHook("rollup:options",e,n),Object.keys(n.input).length===0)return;let o=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(o=!1),o&&(n.cache=t.get(ri,i));const a=await $i(n);o&&t.set(ri,a.cache,i),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const r of n.output){const{output:p}=await a.write(r),l=new Set,c=p.filter(d=>d.type==="chunk");for(const d of c){l.add(d.fileName);for(const m of d.imports)e.usedImports.add(m);d.isEntry&&e.buildEntries.push({chunks:d.imports.filter(m=>c.find(v=>v.fileName===m)),exports:d.exports,modules:Object.entries(d.modules).map(([m,v])=>({bytes:v.renderedLength,id:m})),path:d.fileName,size:{bytes:Buffer.byteLength(d.code,"utf8")},type:"entry"})}const u=p.filter(d=>d.type==="asset");for(const d of u)s.has(d.fileName)||s.set(d.fileName,{path:d.fileName,size:{bytes:Buffer.byteLength(d.source,"utf8")},type:"asset"});for(const d of l)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var _l=Object.defineProperty,Ae=g((e,t)=>_l(e,"name",{value:t,configurable:!0}),"a$c");const li="rollup-dts.json",Tl=Ae(async(e,t,i)=>{if(e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer){e.logger.info({message:"Using isolated declaration transformer to generate declaration files...",prefix:"dts"});return}const n=await mn(e,t);if(await e.hooks.callHook("rollup:dts:options",e,n),Object.keys(n.input).length===0)return;n.cache=t.get(li,i);const o=await $i(n);t.set(li,o.cache,i),await e.hooks.callHook("rollup:dts:build",e,o),e.logger.info({message:"Building declaration files...",prefix:"dts"}),e.options.emitCJS&&await o.write({chunkFileNames:Ae(a=>ae(a,"d.cts"),"chunkFileNames"),dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await o.write({chunkFileNames:Ae(a=>ae(a,"d.mts"),"chunkFileNames"),dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await o.write({chunkFileNames:Ae(a=>ae(a,"d.mjs"),"chunkFileNames"),dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var Il=Object.defineProperty,zl=g((e,t)=>Il(e,"name",{value:t,configurable:!0}),"a$b");const Al=zl(async e=>await new Promise((t,i)=>{let n=0;const o=jt(e).pipe(Do({params:{[Co.BROTLI_PARAM_QUALITY]:11}}));o.on("error",i),o.on("data",a=>{n+=a.length}),o.on("end",()=>{t(n)})}),"brotliSize");var Rl=Object.defineProperty,Fl=g((e,t)=>Rl(e,"name",{value:t,configurable:!0}),"y$4");const Ll=Fl((e,t,i)=>e.reduce((n,o)=>{const a=o[t],s=o[i];return n[a]||(n[a]={}),n[a][s]||(n[a][s]=[]),n[a][s].push(o),n},{}),"groupByKeys");var Jl=Object.defineProperty,Bl=g((e,t)=>Jl(e,"name",{value:t,configurable:!0}),"i$5");const ql=Bl(async e=>await new Promise((t,i)=>{let n=0;const o=jt(e).pipe(No({level:9}));o.on("error",i),o.on("data",a=>{n+=a.length}),o.on("end",()=>{t(n)})}),"gzipSize");var Wl=Object.defineProperty,Ue=g((e,t)=>Wl(e,"name",{value:t,configurable:!0}),"j$1");const Ul=Ue((e,t)=>{const i=Ue(s=>I(t.options.rootDir,P(t.options.outDir,s)),"rPath");let n=!1;const o=[],a=t.buildEntries.filter(s=>s.type==="entry");if(a.length>0){e.raw(`Entries:
|
|
95
|
+
${n.stack}`),i){case"info":{e.logger.info({message:o,prefix:t+(n.plugin?":plugin:"+n.plugin:"")});return}case"warn":{e.logger.warn({message:o,prefix:t+(n.plugin?":plugin:"+n.plugin:"")});return}case"debug":e.logger.debug({message:o,prefix:t+(n.plugin?":plugin:"+n.plugin:"")})}},"onLog"),onwarn(i,n){cn(i,e)||i.code||n(i)},treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),un=F(async(e,t)=>{const i=Ze(e.pkg,e.options);let n;e.options.rollup.resolve&&(n=Si({...e.options.rollup.resolve}));const o=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:vl(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,r]=pn(e.options.rollup.plugins,"build"),p=e.tsconfig?.config.compilerOptions?.esModuleInterop;return{...dn(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:F(l=>ae(l,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:F(l=>ri(l,"cjs"),"entryFileNames"),esModule:p??"if-default-prop",exports:"auto",externalLiveBindings:!1,format:"cjs",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,interop:"compat",sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...o},e.options.emitESM&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:F(l=>ae(l,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:F(l=>ri(l,"mjs"),"entryFileNames"),esModule:p??"if-default-prop",exports:"auto",externalLiveBindings:!1,format:"esm",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...o}].filter(Boolean),plugins:[q(en(),t),e.tsconfig&&q(sn(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&q(on(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),Zi(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),e.options.rollup.replace&&Oi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Ei({customResolver:n,...e.options.rollup.alias,entries:i}),...a,n,e.options.rollup.polyfillNode&&to({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&Ki({...e.options.rollup.json}),ra(),e.options.rollup.wasm&&eo(e.options.rollup.wasm),e.options.rollup.url&&cl(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await os({dts:!!e.options.declaration||e.options.isolatedDeclarationTransformer!==void 0,sourceMap:e.options.sourcemap,...e.options.rollup.css},e.logger,e.options.browserTargets,e.options.rootDir,e.options.sourceDir,e.environment,e.options.sourcemap,e.options.debug,e.options.minify??!1,i),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&e.options.declaration&&ds(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&q(vr(e.options.rollup.raw),t),e.options.sourcemap&&Cr(e.options.rollup.sourcemap),...s,e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&zs($(e.options.rootDir,e.options.sourceDir),e.options.isolatedDeclarationTransformer,e.options.declaration,!!e.options.rollup.cjsInterop,e.logger,e.options.rollup.isolatedDeclarations,e.options.sourcemap,e.tsconfig),e.options.transformer(Sl(e.options.transformerName,e)),q(fr({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&Er(e.options.entries.filter(l=>l.executable).map(l=>l.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Ri({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&Ss(),e.options.rollup.dynamicVars&&Zn(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&q(Qn({sourceMap:e.options.sourcemap,...e.options.rollup.commonjs}),t),e.options.rollup.preserveDynamicImports&&{name:"packem:preserve-dynamic-imports",renderDynamicImport(){return{left:"import(",right:")"}}},e.options.cjsInterop&&e.options.rollup.shim&&js(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&q(Gs({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...r,e.options.rollup.metafile&&ir(),e.options.rollup.copy&&ha(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Xi({dtsMarker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dependenciesTemplate,logger:e.logger,marker:e.options.rollup.license.dependenciesMarker??"DEPENDENCIES",mode:"dependencies",packageName:e.pkg.name}),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&ar(e.logger,e.options.entries,e.options.outDir,e.options.rootDir,e.options.rollup.node10Compatibility.writeToPackageJson?"file":"console",e.options.rollup.node10Compatibility.typeScriptVersion??"*"),e.options.analyze&&e.options.rollup.visualizer!==!1&&io({brotliSize:!0,gzipSize:!0,projectRoot:e.options.rootDir,sourcemap:e.options.sourcemap,...e.options.rollup.visualizer,filename:"packem-bundle-analyze.html",title:"Packem Visualizer"})].filter(Boolean)}},"getRollupOptions"),Ol=F(async e=>{const{dts:t}=require("rollup-plugin-dts");return t({compilerOptions:{...e.options.rollup.dts.compilerOptions,incremental:void 0,inlineSources:void 0,sourceMap:void 0,tsBuildInfoFile:void 0},respectExternal:e.options.rollup.dts.respectExternal,tsconfig:e.tsconfig?.path})},"createDtsPlugin"),Pl=Go(Ol),mn=F(async(e,t)=>{const i=Ze(e.pkg,e.options),n=e.tsconfig?.config.compilerOptions;delete n?.lib;let o;e.options.rollup.resolve&&e.options.experimental?.oxcResolve!==!0?o=Si({...e.options.rollup.resolve}):e.options.experimental?.oxcResolve&&e.options.rollup.experimental?.resolve&&(o=lr(e.options.rollup.experimental.resolve,e.options.rootDir,e.logger,e.tsconfig?.path));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,r,p]=pn(e.options.rollup.plugins,"dts");return{...dn(e,"dts"),onwarn(l,c){cn(l,e)||l.code!=="EMPTY_BUNDLE"&&c(l)},output:[e.options.emitCJS&&{chunkFileNames:F(l=>ae(l,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:F(l=>ae(l,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts",format:"esm",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.declaration==="compatible"&&{chunkFileNames:F(l=>ae(l,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[q(en(),t),q(il(),t),e.options.rollup.json&&Ki({...e.options.rollup.json}),{load(l){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(l)?null:""},name:"packem:ignore-files"},e.tsconfig&&q(sn(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&q(on(e.options.rootDir,e.tsconfig,e.logger,e.options.rollup.tsconfigPaths),t),Zi(e.pkg,e.tsconfig,e.options,e.logger,e.options.rollup.resolveExternals??{}),e.options.rollup.replace&&Oi({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Ei({customResolver:o,...e.options.rollup.alias,entries:i}),...s,o,...r,await Pl(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Ri({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&q(Br(e.options.rollup.patchTypes,e.logger),t),Sr(),...p,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Xi({licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dtsTemplate,logger:e.logger,marker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",mode:"types",packageName:e.pkg.name})].filter(Boolean)}},"getRollupDtsOptions");var Dl=Object.defineProperty,Cl=g((e,t)=>Dl(e,"name",{value:t,configurable:!0}),"m$5");const li="rollup-build.json",Nl=Cl(async(e,t,i)=>{const n=await un(e,t);if(await e.hooks.callHook("rollup:options",e,n),Object.keys(n.input).length===0)return;let o=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(o=!1),o&&(n.cache=t.get(li,i));const a=await $i(n);o&&t.set(li,a.cache,i),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const r of n.output){const{output:p}=await a.write(r),l=new Set,c=p.filter(d=>d.type==="chunk");for(const d of c){l.add(d.fileName);for(const m of d.imports)e.usedImports.add(m);d.isEntry&&e.buildEntries.push({chunks:d.imports.filter(m=>c.find(v=>v.fileName===m)),exports:d.exports,modules:Object.entries(d.modules).map(([m,v])=>({bytes:v.renderedLength,id:m})),path:d.fileName,size:{bytes:Buffer.byteLength(d.code,"utf8")},type:"entry"})}const u=p.filter(d=>d.type==="asset");for(const d of u)s.has(d.fileName)||s.set(d.fileName,{path:d.fileName,size:{bytes:Buffer.byteLength(d.source,"utf8")},type:"asset"});for(const d of l)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var Ml=Object.defineProperty,Ae=g((e,t)=>Ml(e,"name",{value:t,configurable:!0}),"a$c");const pi="rollup-dts.json",_l=Ae(async(e,t,i)=>{if(e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer){e.logger.info({message:"Using isolated declaration transformer to generate declaration files...",prefix:"dts"});return}const n=await mn(e,t);if(await e.hooks.callHook("rollup:dts:options",e,n),Object.keys(n.input).length===0)return;n.cache=t.get(pi,i);const o=await $i(n);t.set(pi,o.cache,i),await e.hooks.callHook("rollup:dts:build",e,o),e.logger.info({message:"Building declaration files...",prefix:"dts"}),e.options.emitCJS&&await o.write({chunkFileNames:Ae(a=>ae(a,"d.cts"),"chunkFileNames"),dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await o.write({chunkFileNames:Ae(a=>ae(a,"d.mts"),"chunkFileNames"),dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await o.write({chunkFileNames:Ae(a=>ae(a,"d.mjs"),"chunkFileNames"),dir:P(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var Tl=Object.defineProperty,Il=g((e,t)=>Tl(e,"name",{value:t,configurable:!0}),"a$b");const zl=Il(async e=>await new Promise((t,i)=>{let n=0;const o=$t(e).pipe(Po({params:{[Do.BROTLI_PARAM_QUALITY]:11}}));o.on("error",i),o.on("data",a=>{n+=a.length}),o.on("end",()=>{t(n)})}),"brotliSize");var Al=Object.defineProperty,Rl=g((e,t)=>Al(e,"name",{value:t,configurable:!0}),"y$4");const Fl=Rl((e,t,i)=>e.reduce((n,o)=>{const a=o[t],s=o[i];return n[a]||(n[a]={}),n[a][s]||(n[a][s]=[]),n[a][s].push(o),n},{}),"groupByKeys");var Ll=Object.defineProperty,Bl=g((e,t)=>Ll(e,"name",{value:t,configurable:!0}),"i$5");const Jl=Bl(async e=>await new Promise((t,i)=>{let n=0;const o=$t(e).pipe(Co({level:9}));o.on("error",i),o.on("data",a=>{n+=a.length}),o.on("end",()=>{t(n)})}),"gzipSize");var ql=Object.defineProperty,Ue=g((e,t)=>ql(e,"name",{value:t,configurable:!0}),"j$1");const Wl=Ue((e,t)=>{const i=Ue(s=>I(t.options.rootDir,P(t.options.outDir,s)),"rPath");let n=!1;const o=[],a=t.buildEntries.filter(s=>s.type==="entry");if(a.length>0){e.raw(`Entries:
|
|
96
96
|
`);for(const s of a){let r=s.size?.bytes??0,p=0;for(const c of s.chunks??[]){const u=t.buildEntries.find(d=>d.path.endsWith(c))?.size?.bytes??0;r+=u,p+=u}let l=` ${K(i(s.path))} (${["total size: "+D(R(r,{decimals:2})),s.size?.brotli&&"brotli size: "+D(R(s.size.brotli,{decimals:2})),s.size?.gzip&&"gzip size: "+D(R(s.size.gzip,{decimals:2})),p!==0&&"chunk size: "+D(R(p,{decimals:2}))].filter(Boolean).join(", ")})`;if(l+=s.exports?.length?`
|
|
97
97
|
exports: `+ie(s.exports.join(", ")):"",s.chunks?.length&&(l+=`
|
|
98
98
|
${s.chunks.map(c=>{const u=t.buildEntries.find(d=>d.path===c)??{};return ie(" └─ "+i(c)+K(u.bytes?" ("+R(u?.bytes,{decimals:2})+")":""))}).join(`
|
|
@@ -109,31 +109,31 @@ ${s.chunks.map(c=>{const u=t.buildEntries.find(d=>d.path===c)??{};return ie("
|
|
|
109
109
|
└─ `)+K(i(r.path))+" (total size: "+D(R(r.size?.bytes??0,{decimals:2}))+")";s+=`
|
|
110
110
|
|
|
111
111
|
`,e.raw(s)}return n&&e.raw("Σ Total dist size (byte size):",D(R(t.buildEntries.reduce((s,r)=>s+(r.size?.bytes??0),0),{decimals:2})),`
|
|
112
|
-
`),n},"showSizeInformation"),Vl=Ue((e,t)=>{const i=Ll(e.options.entries,"environment","runtime"),n=new Set,o=new Set;for(const[a,s]of Object.entries(i))for(const[r,p]of Object.entries(s)){const l={...e};!e.options.dtsOnly&&(a!=="undefined"||r!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":D(a)+" environment"+(r==="undefined"?"":" with "))+(r==="undefined"?"":D(r)+" runtime"));const c={};l.options.rollup.replace?(l.options.rollup.replace.values===void 0&&(l.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(r==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let u="";a!=="undefined"&&(u+=a+"/"),r!=="undefined"&&(u+=r+"/");let d=!1;l.options.minify!==void 0&&(d=l.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const m=[],v=[],h=[],x=[];for(const f of p)f.cjs&&f.esm?m.push(f):f.cjs?h.push(f):f.esm?v.push(f):f.declaration&&x.push(f);if(m.length>0){const f={...l,options:{...l.options,emitCJS:!0,emitESM:!0,entries:m,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const k=f.options.entries.filter(b=>b.declaration);k.length>0&&o.add({context:{...f,options:{...f.options,entries:k}},fileCache:t,subDirectory:u})}}if(v.length>0){const f={...l,options:{...l.options,emitCJS:!1,emitESM:!0,entries:v,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const k=f.options.entries.filter(b=>b.declaration);k.length>0&&o.add({context:{...f,options:{...f.options,entries:k}},fileCache:t,subDirectory:u})}}if(h.length>0){const f={...l,options:{...l.options,emitCJS:!0,emitESM:!1,entries:h,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const k=f.options.entries.filter(b=>b.declaration);k.length>0&&o.add({context:{...f,options:{...f.options,entries:k}},fileCache:t,subDirectory:u})}}l.options.declaration&&x.length>0&&o.add({context:{...l,options:{...l.options,emitCJS:!1,emitESM:!1,entries:x,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:u})}return{builders:n,typeBuilders:o}},"prepareRollupConfig"),Kl=Ue(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:n}=Vl(e,t);await Promise.all([...i].map(async({context:o,fileCache:a,subDirectory:s})=>await Ml(o,a,s))),await Promise.all([...n].map(async({context:o,fileCache:a,subDirectory:s})=>await Tl(o,a,s))),e.logger.success(Rn(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded")),e.buildEntries=e.buildEntries.filter((o,a,s)=>s.findIndex(r=>r.path===o.path)===a);for await(const o of _n($(e.options.rootDir,e.options.outDir),{includeDirs:!1,includeFiles:!0})){const a=$(e.options.rootDir,e.options.outDir);let s=e.buildEntries.find(p=>$(a,p.path)===o.path);s||(s={chunk:!0,path:o.path},e.buildEntries.push(s)),s.size===void 0&&(s.size={});const r=P(a,o.path);if(!s.size.bytes){const p=await wt(r);s.size.bytes=p.size}s.size.brotli||(s.size.brotli=await Al(r)),s.size.gzip||(s.size.gzip=await ql(r))}return await e.hooks.callHook("build:done",e),Ul(e.logger,e)},"build");var Gl=Object.defineProperty,Hl=g((e,t)=>Gl(e,"name",{value:t,configurable:!0}),"r$4");const C=Hl((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Yl=Object.defineProperty,fn=g((e,t)=>Yl(e,"name",{value:t,configurable:!0}),"t$4");const Ve=fn(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),bt=fn((e,t,i,n)=>{if(e==="module-sync")return"esm";if(n){const s=Ve(n);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return i;const[o,...a]=t;return bt(o,a,i,n)},"inferExportType");var Xl=Object.defineProperty,Ql=g((e,t)=>Xl(e,"name",{value:t,configurable:!0}),"y$3");const Zl=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...$t,...qe]),Pt=Ql((e,t,i,n=[])=>{if(!e)return[];if(typeof e=="string"){const o=Ve(e);if(o&&o!==t)throw new Error(`Exported file "${e}" has an extension that does not match the package.json type "${t==="esm"?"module":"commonjs"}".`);return[{file:e,key:"exports",type:o??t}]}if(typeof e=="object"){const o=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,r]of o)if(typeof r=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:r,key:"exports",type:bt(s,n,t,r)})}else if(typeof r=="object"&&r!==null)for(const[p,l]of Object.entries(r)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof l=="string"?a.push({exportKey:c.replace("./",""),file:l,key:"exports",...Zl.has(p)?{subKey:p}:{},type:bt(p,n,t,l)}):a=[...a,...Pt({[c]:l},t,i,[...n,p])]}return a}return[]},"extractExportFilenames");var ep=Object.defineProperty,tt=g((e,t)=>ep(e,"name",{value:t,configurable:!0}),"c$6");const tp=tt((e,t)=>e.key==="exports"&&e.subKey===oe?oe:e.key==="exports"&&e.subKey===Be?Be:t,"getEnvironment"),Re=tt((e,t,i,n,o,a,s)=>{const r=tp(o,a.environment);let p=a.options.runtime;for(const u of $t)if(o.file.includes("."+u+".")||o.subKey===u){p=u;break}let l=e.find(u=>u.input===t&&u.environment===r&&u.runtime===p);l===void 0?l=e[e.push({environment:r,exportKey:new Set([o.exportKey].filter(Boolean)),input:t,runtime:p})-1]:l.exportKey&&o.exportKey&&l.exportKey.add(o.exportKey),s&&(l.isGlob=!0),i&&(l.outDir=n),o.isExecutable?(l.executable=!0,l.declaration=!1,o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0)):(/\.d\.[mc]?ts$/.test(o.file)&&a.options.declaration!==!1&&(l.declaration=a.options.declaration),o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0));const c=o.file.replace(Ne(o.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");qe.has(o.subKey)&&!t.includes(c)&&(l.fileAlias=c)},"createOrUpdateEntry");let pi=!1;const ci=tt(e=>{if(e.pkg?.dependencies?.typescript===void 0&&e.pkg?.devDependencies?.typescript===void 0)throw new Error("You tried to use a `.ts`, `.cts` or `.mts` file but `typescript` was not found in your package.json.")},"validateIfTypescriptIsInstalled"),ip=tt((e,t,i)=>{const n=[];t.sort((r,p)=>r.split("/").length-p.split("/").length);const o=e.type==="module"?"esm":"cjs";o==="esm"&&(i.options.emitESM=!0),o==="cjs"&&(i.options.emitCJS=!0);const a=Pt(e.exports,o,i.options.declaration);if(e.bin){const r=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of r){const l=Ve(p);if(l&&l!==o)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:l??o})}}e.main&&a.push({file:e.main,key:"main",type:Ve(e.main)??o}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(ci(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const r of a){const p=Ne(r.file);if(p!==""&&!Ye.includes(p))continue;i.options.declaration===void 0&&(r.key==="types"||r.subKey==="types")&&(i.options.declaration=r.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&r.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&r.type==="esm"&&(i.options.emitESM=!0);const l=r.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=l.endsWith("/");if(c&&["./","/"].includes(l))continue;const u=l.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",m=c?"":"(\\.[cm]?[tj]sx?)$";if(r.file.includes("/*")&&r.key==="exports"){pi||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),pi=!0);const f=[],k=new RegExp(d+u.replace("*","(.*)")+m),b=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+m);for(const y of t)(k.test(y)||qe.has(r.subKey)&&b.test(y))&&f.push(y);if(f.length===0){n.push(`Could not find entrypoint for \`${r.file}\``);continue}for(const y of f)Re(s,y,c,l,r,i,!0);continue}const v=new RegExp(d+u+m);let h=t.find(f=>v.test(f));if(qe.has(r.subKey)&&h===void 0){const f=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1")+m);h=t.find(k=>f.test(k))}if(h===void 0){L(P(i.options.rootDir,r.file))||n.push(`Could not find entrypoint for \`${r.file}\``);continue}(h.endsWith(".ts")||h.endsWith(".cts")||h.endsWith(".mts"))&&L(h)&&ci(i);const x=Le(h.replace(se,""));L(x+".cts")&&L(x+".mts")?(Re(s,x+".cts",c,l,{...r,type:"cjs"},i,!1),Re(s,x+".mts",c,l,{...r,type:"esm"},i,!1)):Re(s,h,c,l,r,i,!1)}return{entries:s,warnings:n}},"inferEntries");var np=Object.defineProperty,op=g((e,t)=>np(e,"name",{value:t,configurable:!0}),"o$1");const ap=op((e,t)=>{const{publishConfig:i}=e;return i&&(i.bin&&(typeof i.bin=="object"||typeof i.bin=="string")&&(e.bin=i.bin),i.type&&typeof i.type=="string"&&i.type!==""&&(e.type=i.type),i.main&&typeof i.main=="string"&&i.main!==""&&(e.main=i.main),i.module&&typeof i.module=="string"&&i.module!==""&&(e.module=i.module),t===void 0&&i.types&&typeof i.types=="string"&&i.types!==""?e.types=i.types:t===void 0&&i.typings&&typeof i.typings=="string"&&i.typings!==""&&(e.typings=i.typings),i.exports&&typeof i.exports=="object"&&(e.exports=i.exports)),e},"overwriteWithPublishConfig");var sp=Object.defineProperty,rp=g((e,t)=>sp(e,"name",{value:t,configurable:!0}),"t$3");const lp={hooks:{"build:prepare":rp(function(e){if(e.options.entries.length>0)return;const t=$(e.options.rootDir,e.options.sourceDir);if(!L(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=Tn(t,{extensions:[],includeDirs:!1,includeSymlinks:!1});if(i.length===0)throw new Error("No source files found in 'src' directory. Please provide entries manually.");let n={...e.pkg};n.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(n.publishConfig).join(", ")+'".'),e.logger.debug(n.publishConfig),n=ap(n,e.options.declaration));const o=ip(n,i,e);for(const a of o.warnings)C(e,a);if(e.options.entries.push(...o.entries),e.options.entries.length===0)throw new Error("No entries detected. Please provide entries manually.");e.logger.info("Automatically detected entries:",D(e.options.entries.map(a=>a.fileAlias?K(a.fileAlias)+" => "+K(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):K(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),ie([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var pp=Object.defineProperty,cp=g((e,t)=>pp(e,"name",{value:t,configurable:!0}),"t$2");const dp=cp(async(e,t)=>{if(e==="auto")e=lp;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var up=Object.defineProperty,mp=g((e,t)=>up(e,"name",{value:t,configurable:!0}),"j");const fp=mp(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],n=JSON.stringify({...e.options.jiti,alias:{...Ze(e.pkg,e.options),...e.options.jiti.alias},transformOptions:{...e.options.jiti.transformOptions,babel:{...e.options.jiti.transformOptions?.babel,plugins:"__$BABEL_PLUGINS"}}},null,2).replace('"__$BABEL_PLUGINS"',Array.isArray(t)?"["+t.map((o,a)=>{if(Array.isArray(o)){const[s,...r]=o;return i.push(s),"["+["plugin"+a,...r.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(o),"plugin"+a}).join(",")+"]":"[]");for(const o of e.options.entries){const a=P(e.options.rootDir,e.options.outDir,o.name),s=ho(e.jiti.esmResolve(o.input,{try:!0})??o.input),r=s.replace(se,""),p=He(s),l=Pr(p);let c=[];try{c=await vo(s,{extensions:Ye})}catch(d){C(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const u=c.includes("default")||c.length===0;if(e.options.emitESM){const d=I(_(a),await zt("jiti",{conditions:["node","import"],url:import.meta.url})),m=r+".d.mts";ce(`${a}.mjs`,l+['import { createJiti } from "'+d+'";',...i.map((v,h)=>"import plugin"+h+' from "'+v+'";'),"","const jiti = createJiti(import.meta.url, "+n+");","",'/** @type {import("'+m+'")} */','const _module = await jiti.import("'+s+'");',u?`
|
|
112
|
+
`),n},"showSizeInformation"),Ul=Ue((e,t)=>{const i=Fl(e.options.entries,"environment","runtime"),n=new Set,o=new Set;for(const[a,s]of Object.entries(i))for(const[r,p]of Object.entries(s)){const l={...e};!e.options.dtsOnly&&(a!=="undefined"||r!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":D(a)+" environment"+(r==="undefined"?"":" with "))+(r==="undefined"?"":D(r)+" runtime"));const c={};l.options.rollup.replace?(l.options.rollup.replace.values===void 0&&(l.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(r==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let u="";a!=="undefined"&&(u+=a+"/"),r!=="undefined"&&(u+=r+"/");let d=!1;l.options.minify!==void 0&&(d=l.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const m=[],v=[],h=[],x=[];for(const f of p)f.cjs&&f.esm?m.push(f):f.cjs?h.push(f):f.esm?v.push(f):f.declaration&&x.push(f);if(m.length>0){const f={...l,options:{...l.options,emitCJS:!0,emitESM:!0,entries:m,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const k=f.options.entries.filter(b=>b.declaration);k.length>0&&o.add({context:{...f,options:{...f.options,entries:k}},fileCache:t,subDirectory:u})}}if(v.length>0){const f={...l,options:{...l.options,emitCJS:!1,emitESM:!0,entries:v,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const k=f.options.entries.filter(b=>b.declaration);k.length>0&&o.add({context:{...f,options:{...f.options,entries:k}},fileCache:t,subDirectory:u})}}if(h.length>0){const f={...l,options:{...l.options,emitCJS:!0,emitESM:!1,entries:h,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||n.add({context:f,fileCache:t,subDirectory:u}),e.options.declaration){const k=f.options.entries.filter(b=>b.declaration);k.length>0&&o.add({context:{...f,options:{...f.options,entries:k}},fileCache:t,subDirectory:u})}}l.options.declaration&&x.length>0&&o.add({context:{...l,options:{...l.options,emitCJS:!1,emitESM:!1,entries:x,minify:d,rollup:{...l.options.rollup,replace:l.options.rollup.replace?{...l.options.rollup.replace,values:{...l.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:u})}return{builders:n,typeBuilders:o}},"prepareRollupConfig"),Vl=Ue(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:n}=Ul(e,t);await Promise.all([...i].map(async({context:o,fileCache:a,subDirectory:s})=>await Nl(o,a,s))),await Promise.all([...n].map(async({context:o,fileCache:a,subDirectory:s})=>await _l(o,a,s))),e.logger.success(An(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded")),e.buildEntries=e.buildEntries.filter((o,a,s)=>s.findIndex(r=>r.path===o.path)===a);for await(const o of Mn($(e.options.rootDir,e.options.outDir),{includeDirs:!1,includeFiles:!0})){const a=$(e.options.rootDir,e.options.outDir);let s=e.buildEntries.find(p=>$(a,p.path)===o.path);s||(s={chunk:!0,path:o.path},e.buildEntries.push(s)),s.size===void 0&&(s.size={});const r=P(a,o.path);if(!s.size.bytes){const p=await kt(r);s.size.bytes=p.size}s.size.brotli||(s.size.brotli=await zl(r)),s.size.gzip||(s.size.gzip=await Jl(r))}return await e.hooks.callHook("build:done",e),Wl(e.logger,e)},"build");var Kl=Object.defineProperty,Gl=g((e,t)=>Kl(e,"name",{value:t,configurable:!0}),"r$4");const C=Gl((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Hl=Object.defineProperty,fn=g((e,t)=>Hl(e,"name",{value:t,configurable:!0}),"t$4");const Ve=fn(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),bt=fn((e,t,i,n)=>{if(e==="module-sync")return"esm";if(n){const s=Ve(n);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return i;const[o,...a]=t;return bt(o,a,i,n)},"inferExportType");var Yl=Object.defineProperty,Xl=g((e,t)=>Yl(e,"name",{value:t,configurable:!0}),"y$3");const Ql=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...Et,...qe]),Dt=Xl((e,t,i,n=[])=>{if(!e)return[];if(typeof e=="string"){const o=Ve(e);if(o&&o!==t)throw new Error(`Exported file "${e}" has an extension that does not match the package.json type "${t==="esm"?"module":"commonjs"}".`);return[{file:e,key:"exports",type:o??t}]}if(typeof e=="object"){const o=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,r]of o)if(typeof r=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:r,key:"exports",type:bt(s,n,t,r)})}else if(typeof r=="object"&&r!==null)for(const[p,l]of Object.entries(r)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof l=="string"?a.push({exportKey:c.replace("./",""),file:l,key:"exports",...Ql.has(p)?{subKey:p}:{},type:bt(p,n,t,l)}):a=[...a,...Dt({[c]:l},t,i,[...n,p])]}return a}return[]},"extractExportFilenames");var Zl=Object.defineProperty,tt=g((e,t)=>Zl(e,"name",{value:t,configurable:!0}),"c$6");const ep=tt((e,t)=>e.key==="exports"&&e.subKey===oe?oe:e.key==="exports"&&e.subKey===Je?Je:t,"getEnvironment"),Re=tt((e,t,i,n,o,a,s)=>{const r=ep(o,a.environment);let p=a.options.runtime;for(const u of Et)if(o.file.includes("."+u+".")||o.subKey===u){p=u;break}let l=e.find(u=>u.input===t&&u.environment===r&&u.runtime===p);l===void 0?l=e[e.push({environment:r,exportKey:new Set([o.exportKey].filter(Boolean)),input:t,runtime:p})-1]:l.exportKey&&o.exportKey&&l.exportKey.add(o.exportKey),s&&(l.isGlob=!0),i&&(l.outDir=n),o.isExecutable?(l.executable=!0,l.declaration=!1,o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0)):(/\.d\.[mc]?ts$/.test(o.file)&&a.options.declaration!==!1&&(l.declaration=a.options.declaration),o.type==="cjs"?l.cjs=!0:o.type==="esm"&&(l.esm=!0));const c=o.file.replace(Ne(o.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");qe.has(o.subKey)&&!t.includes(c)&&(l.fileAlias=c)},"createOrUpdateEntry");let ci=!1;const di=tt(e=>{if(e.pkg?.dependencies?.typescript===void 0&&e.pkg?.devDependencies?.typescript===void 0)throw new Error("You tried to use a `.ts`, `.cts` or `.mts` file but `typescript` was not found in your package.json.")},"validateIfTypescriptIsInstalled"),tp=tt((e,t,i)=>{const n=[];t.sort((r,p)=>r.split("/").length-p.split("/").length);const o=e.type==="module"?"esm":"cjs";o==="esm"&&(i.options.emitESM=!0),o==="cjs"&&(i.options.emitCJS=!0);const a=Dt(e.exports,o,i.options.declaration);if(e.bin){const r=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of r){const l=Ve(p);if(l&&l!==o)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:l??o})}}e.main&&a.push({file:e.main,key:"main",type:Ve(e.main)??o}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(di(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const r of a){const p=Ne(r.file);if(p!==""&&!Ye.includes(p))continue;i.options.declaration===void 0&&(r.key==="types"||r.subKey==="types")&&(i.options.declaration=r.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&r.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&r.type==="esm"&&(i.options.emitESM=!0);const l=r.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=l.endsWith("/");if(c&&["./","/"].includes(l))continue;const u=l.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",m=c?"":"(\\.[cm]?[tj]sx?)$";if(r.file.includes("/*")&&r.key==="exports"){ci||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),ci=!0);const f=[],k=new RegExp(d+u.replace("*","(.*)")+m),b=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+m);for(const y of t)(k.test(y)||qe.has(r.subKey)&&b.test(y))&&f.push(y);if(f.length===0){n.push(`Could not find entrypoint for \`${r.file}\``);continue}for(const y of f)Re(s,y,c,l,r,i,!0);continue}const v=new RegExp(d+u+m);let h=t.find(f=>v.test(f));if(qe.has(r.subKey)&&h===void 0){const f=new RegExp(d+u.replace(/(.*)\.[^.]*$/,"$1")+m);h=t.find(k=>f.test(k))}if(h===void 0){L(P(i.options.rootDir,r.file))||n.push(`Could not find entrypoint for \`${r.file}\``);continue}(h.endsWith(".ts")||h.endsWith(".cts")||h.endsWith(".mts"))&&L(h)&&di(i);const x=Le(h.replace(se,""));L(x+".cts")&&L(x+".mts")?(Re(s,x+".cts",c,l,{...r,type:"cjs"},i,!1),Re(s,x+".mts",c,l,{...r,type:"esm"},i,!1)):Re(s,h,c,l,r,i,!1)}return{entries:s,warnings:n}},"inferEntries");var ip=Object.defineProperty,np=g((e,t)=>ip(e,"name",{value:t,configurable:!0}),"o$1");const op=np((e,t)=>{const{publishConfig:i}=e;return i&&(i.bin&&(typeof i.bin=="object"||typeof i.bin=="string")&&(e.bin=i.bin),i.type&&typeof i.type=="string"&&i.type!==""&&(e.type=i.type),i.main&&typeof i.main=="string"&&i.main!==""&&(e.main=i.main),i.module&&typeof i.module=="string"&&i.module!==""&&(e.module=i.module),t===void 0&&i.types&&typeof i.types=="string"&&i.types!==""?e.types=i.types:t===void 0&&i.typings&&typeof i.typings=="string"&&i.typings!==""&&(e.typings=i.typings),i.exports&&typeof i.exports=="object"&&(e.exports=i.exports)),e},"overwriteWithPublishConfig");var ap=Object.defineProperty,sp=g((e,t)=>ap(e,"name",{value:t,configurable:!0}),"t$3");const rp={hooks:{"build:prepare":sp(function(e){if(e.options.entries.length>0)return;const t=$(e.options.rootDir,e.options.sourceDir);if(!L(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=_n(t,{extensions:[],includeDirs:!1,includeSymlinks:!1});if(i.length===0)throw new Error("No source files found in 'src' directory. Please provide entries manually.");let n={...e.pkg};n.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(n.publishConfig).join(", ")+'".'),e.logger.debug(n.publishConfig),n=op(n,e.options.declaration));const o=tp(n,i,e);for(const a of o.warnings)C(e,a);if(e.options.entries.push(...o.entries),e.options.entries.length===0)throw new Error("No entries detected. Please provide entries manually.");e.logger.info("Automatically detected entries:",D(e.options.entries.map(a=>a.fileAlias?K(a.fileAlias)+" => "+K(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):K(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),ie([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var lp=Object.defineProperty,pp=g((e,t)=>lp(e,"name",{value:t,configurable:!0}),"t$2");const cp=pp(async(e,t)=>{if(e==="auto")e=rp;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var dp=Object.defineProperty,up=g((e,t)=>dp(e,"name",{value:t,configurable:!0}),"j");const mp=up(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],n=JSON.stringify({...e.options.jiti,alias:{...Ze(e.pkg,e.options),...e.options.jiti.alias},transformOptions:{...e.options.jiti.transformOptions,babel:{...e.options.jiti.transformOptions?.babel,plugins:"__$BABEL_PLUGINS"}}},null,2).replace('"__$BABEL_PLUGINS"',Array.isArray(t)?"["+t.map((o,a)=>{if(Array.isArray(o)){const[s,...r]=o;return i.push(s),"["+["plugin"+a,...r.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(o),"plugin"+a}).join(",")+"]":"[]");for(const o of e.options.entries){const a=P(e.options.rootDir,e.options.outDir,o.name),s=go(e.jiti.esmResolve(o.input,{try:!0})??o.input),r=s.replace(se,""),p=He(s),l=Or(p);let c=[];try{c=await ho(s,{extensions:Ye})}catch(d){C(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const u=c.includes("default")||c.length===0;if(e.options.emitESM){const d=I(_(a),await At("jiti",{conditions:["node","import"],url:import.meta.url})),m=r+".d.mts";ce(`${a}.mjs`,l+['import { createJiti } from "'+d+'";',...i.map((v,h)=>"import plugin"+h+' from "'+v+'";'),"","const jiti = createJiti(import.meta.url, "+n+");","",'/** @type {import("'+m+'")} */','const _module = await jiti.import("'+s+'");',u?`
|
|
113
113
|
export default _module?.default ?? _module;`:"",...c.filter(v=>v!=="default").map(v=>`export const ${v} = _module.${v};`)].join(`
|
|
114
114
|
`)),e.options.declaration&&ce(`${a}.d.mts`,'export * from "'+m+`";
|
|
115
|
-
`+(u?'export { default } from "'+m+'";':""))}if(e.options.emitCJS){const d=I(_(a),await
|
|
115
|
+
`+(u?'export { default } from "'+m+'";':""))}if(e.options.emitCJS){const d=I(_(a),await At("jiti",{conditions:["node","require"],url:import.meta.url})),m=r+".d.cts";ce(`${a}.cjs`,l+['const { createJiti } = require("'+d+'");',...i.map((v,h)=>"const plugin"+h+" = require("+JSON.stringify(v)+")"),"","const jiti = createJiti(__filename, "+n+");","",'/** @type {import("'+m+'")} */','module.exports = jiti("'+s+'")'].join(`
|
|
116
116
|
`)),e.options.declaration&&ce(a+".d.cts",'export * from "'+m+`";
|
|
117
|
-
`+(u?'export { default } from "'+m+'";':""))}l&&(await yt(`${a}.cjs`),await yt(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var
|
|
118
|
-
`;return n.startsWith(o)?n.slice(o.length):n},"extractStack"),
|
|
117
|
+
`+(u?'export { default } from "'+m+'";':""))}l&&(await yt(`${a}.cjs`),await yt(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var fp=Object.defineProperty,Ct=g((e,t)=>fp(e,"name",{value:t,configurable:!0}),"i$3");const gp=Ct(e=>{const{message:t,name:i="Error",stack:n}=e;if(!n)return;const o=`${i}: ${t}
|
|
118
|
+
`;return n.startsWith(o)?n.slice(o.length):n},"extractStack"),hp=Ct(e=>`
|
|
119
119
|
${e.replaceAll(/^\n|\n$/g,"")}
|
|
120
|
-
`,"normalizeCodeFrame"),gn=
|
|
120
|
+
`,"normalizeCodeFrame"),gn=Ct(e=>{const t=gp(e);let i=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(i+=`
|
|
121
121
|
file: ${D(e.id+(e.loc?":"+e.loc.line+":"+e.loc.column:""))}`),e.frame&&(i+=`
|
|
122
|
-
`+
|
|
123
|
-
${t}`)},"enhanceRollupError");var
|
|
122
|
+
`+Rn(hp(e.frame))),e.message=i,t!==void 0&&(e.stack=`${e.message}
|
|
123
|
+
${t}`)},"enhanceRollupError");var vp=Object.defineProperty,hn=g((e,t)=>vp(e,"name",{value:t,configurable:!0}),"d$5");const Ke="rollup-watch.json",ui=hn(({context:e,doOnSuccessCleanup:t,fileCache:i,mode:n,runBuilder:o,runOnsuccess:a,useCache:s,watcher:r})=>{const p="watcher:"+n;r.on("change",async(l,{event:c})=>{await t?.(),e.logger.info({message:`${D(I(".",l))} was ${c}d`,prefix:p})}),r.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:p})}),r.on("event",async l=>{switch(l.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:p}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:D("build started..."),prefix:p});break}case"BUNDLE_END":{await l.result.close(),s&&i.set(n==="bundle"?Ke:"dts-"+Ke,l.result.cache),e.logger.raw(`
|
|
124
124
|
⚡️ Build run in `+l.duration+`ms
|
|
125
125
|
|
|
126
|
-
`),await o?.(!0);break}case"ERROR":{gn(l.error),e.logger.error({context:[l.error],message:"Rebuild failed: "+l.error.message,prefix:p});break}}})},"watchHandler"),
|
|
127
|
-
└─ ${I(process.cwd(),c)}`);if(e.logger.info(l),
|
|
126
|
+
`),await o?.(!0);break}case"ERROR":{gn(l.error),e.logger.error({context:[l.error],message:"Rebuild failed: "+l.error.message,prefix:p});break}}})},"watchHandler"),xp=hn(async(e,t,i,n,o)=>{const a=await un(e,t);if(await e.hooks.callHook("rollup:options",e,a),Object.keys(a.input).length===0)return;let s=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(s=!1),s&&(a.cache=t.get(Ke)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[$(e.options.sourceDir,"**","*"),"package.json","packem.config.*","tsconfig.json","tsconfig.*.json"],Array.isArray(e.options.rollup.watch.include)?a.watch.include=[...a.watch.include,...e.options.rollup.watch.include]:e.options.rollup.watch.include&&a.watch.include.push(e.options.rollup.watch.include),a.watch.chokidar={cwd:e.options.rootDir,...a.watch.chokidar,ignored:["**/.git/**","**/node_modules/**","**/test-results/**",...a.watch.chokidar?.ignored??[]]});const r=It(a);await e.hooks.callHook("rollup:watch",e,r);const p=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let l="Starting watcher for entries:";for(const c of p)l+=ie(`
|
|
127
|
+
└─ ${I(process.cwd(),c)}`);if(e.logger.info(l),ui({context:e,doOnSuccessCleanup:o,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:n,useCache:s,watcher:r}),e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer)e.logger.info({message:"Using isolated declaration transformer to generate declaration files...",prefix:"dts"});else if(e.options.declaration){const c=await mn(e,t);s&&(c.cache=t.get("dts-"+Ke)),await e.hooks.callHook("rollup:dts:options",e,c);const u=It(c);await e.hooks.callHook("rollup:watch",e,u),ui({context:e,fileCache:t,mode:"types",useCache:s,watcher:u})}},"watch");var yp=Object.defineProperty,bp=g((e,t)=>yp(e,"name",{value:t,configurable:!0}),"s$6");const wp=bp(async e=>{const t=[];if(e.options.clean)for(const i of new Set(e.options.entries.map(n=>n.outDir).filter(Boolean).sort()))i===e.options.rootDir||i===e.options.sourceDir||e.options.rootDir.startsWith(i.endsWith("/")?i:`${i}/`)||t.some(n=>i.startsWith(n))||(t.push(i),e.logger.info(`Cleaning dist directory: \`./${I(e.options.rootDir,i)}\``),await Tn(i))},"cleanDistributionDirectories");var kp=Object.defineProperty,jp=g((e,t)=>kp(e,"name",{value:t,configurable:!0}),"i$2");const $p=jp((e,t,i,n)=>{try{let o={};const a=$(t,"keystore.json");n&&L(a)&&(o=In(a)),o[e]===void 0&&(o[e]=new Date().toISOString()),wt(a,o,{overwrite:!0})}catch(o){i.debug({context:[o],message:o.message,prefix:"cache-key-store"})}},"createOrUpdateKeyStorage");var Ep=Object.defineProperty,vn=g((e,t)=>Ep(e,"name",{value:t,configurable:!0}),"s$5");const Sp=vn(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let Op=class{static{g(this,"g")}static{vn(this,"FileCache")}#e;#i;#a;#r=!0;#s=new Map;constructor(t,i,n,o){this.#e=t,this.#a=n,i===void 0?o.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#i=i,o.debug({message:"Cache path is: "+this.#i,prefix:"file-cache"}))}set isEnabled(t){this.#r=t}has(t,i){return!this.#r||this.#i===void 0?!1:L(this.getFilePath(t,i))}get(t,i){if(!this.#r||this.#i===void 0)return;const n=this.getFilePath(t,i);if(this.#s.has(n))return this.#s.get(n);if(!L(n))return;const o=He(n);if(Sp(o)){const a=JSON.parse(o);return this.#s.set(n,a),a}return this.#s.set(n,o),o}set(t,i,n){if(!this.#r||this.#i===void 0||i===void 0)return;const o=this.getFilePath(t,n);(typeof i=="object"||typeof i=="number"||typeof i=="boolean")&&(i=JSON.stringify(i)),ce(o,i,{overwrite:!0})}getFilePath(t,i){let n=t.replaceAll(Le(this.#e),"");return n=n.replaceAll(":","-"),$(this.#i,this.#a,i?.replaceAll(":","-")??"",Le(n))}};var Pp=Object.defineProperty,Fe=g((e,t)=>Pp(e,"name",{value:t,configurable:!0}),"l$5");const Dp=Y,Cp=Fe((e,t)=>{const{sideEffects:i}=t;let n;if(typeof i=="boolean")n=Fe(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)n=Fe(()=>!1,"hasSideEffects");else{const o=i.map(a=>a.includes("/")?a:`**/${a}`);n=Dp(o,null,{resolve:e})}else n=Fe(()=>null,"hasSideEffects");return n},"getPackageSideEffect");var ct,mi;function Np(){if(mi)return ct;mi=1;var e=Object.defineProperty,t=g((p,l)=>e(p,"name",{value:l,configurable:!0}),"s"),i=No,n=i.spawn,o=i.exec;ct=g(function(p,l,c){if(typeof l=="function"&&c===void 0&&(c=l,l=void 0),p=parseInt(p),Number.isNaN(p)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var u={},d={};switch(u[p]=[],d[p]=1,process.platform){case"win32":o("taskkill /pid "+p+" /T /F",c);break;case"darwin":r(p,u,d,function(m){return n("pgrep",["-P",m])},function(){a(u,l,c)});break;default:r(p,u,d,function(m){return n("ps",["-o","pid","--no-headers","--ppid",m])},function(){a(u,l,c)});break}},"treeKill");function a(p,l,c){var u={};try{Object.keys(p).forEach(function(d){p[d].forEach(function(m){u[m]||(s(m,l),u[m]=1)}),u[d]||(s(d,l),u[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}g(a,"killAll"),t(a,"killAll");function s(p,l){try{process.kill(parseInt(p,10),l)}catch(c){if(c.code!=="ESRCH")throw c}}g(s,"killPid"),t(s,"killPid");function r(p,l,c,u,d){var m=u(p),v="";m.stdout.on("data",function(f){var f=f.toString("ascii");v+=f});var h=t(function(x){if(delete c[p],x!=0){Object.keys(c).length==0&&d();return}v.match(/\d+/g).forEach(function(f){f=parseInt(f,10),l[p].push(f),l[f]=[],c[f]=1,r(f,l,c,u,d)})},"onClose");m.on("close",h)}return g(r,"buildProcessTree"),t(r,"buildProcessTree"),ct}g(Np,"requireTreeKill");var Mp=Np();const _p=Fi(Mp);var Tp=Object.defineProperty,xn=g((e,t)=>Tp(e,"name",{value:t,configurable:!0}),"l$4");const Ip=xn(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),zp=xn(async({pid:e,signal:t})=>await new Promise((i,n)=>{if(!Number.isInteger(e)||e<=0){n(new Error("Invalid process ID"));return}_p(e,t,o=>{if(o&&!Ip(o)){n(o);return}i()})}),"killProcess");var Ap=Object.defineProperty,Rp=g((e,t)=>Ap(e,"name",{value:t,configurable:!0}),"n$1");const yn=Rp(e=>{const t=$(e,"package.json");if(!L(t))throw new Error("package.json not found at "+t);return{packageJson:Mi(t),packageJsonPath:t}},"loadPackageJson");var Fp=Object.defineProperty,Lp=g((e,t)=>Fp(e,"name",{value:t,configurable:!0}),"r$2");const fi=Lp((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
|
|
128
128
|
`),e.logger.warn(`Build is done with some warnings:
|
|
129
129
|
|
|
130
130
|
${[...e.warnings].map(i=>`- ${i}`).join(`
|
|
131
|
-
`)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var Bp=Object.defineProperty,bn=g((e,t)=>Bp(e,"name",{value:t,configurable:!0}),"r$1");const
|
|
131
|
+
`)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var Bp=Object.defineProperty,bn=g((e,t)=>Bp(e,"name",{value:t,configurable:!0}),"r$1");const gi=bn(async(e,t)=>{if(typeof e.name!="string"){let i=Ce(e.input)?I(t.options.rootDir,e.input):G(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(se,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);jt(e.input)&&(e.input=P(t.options.rootDir,e.input)),t.options.declaration&&e.declaration===void 0&&(e.declaration=t.options.declaration),e.executable&&(e.cjs===void 0||e.esm===void 0)?t.pkg.type==="commonjs"&&e.cjs===void 0&&t.options.emitCJS!==void 0?(e.cjs=t.options.emitCJS,e.esm=!1):t.pkg.type==="module"&&e.esm===void 0&&t.options.emitESM!==void 0&&(e.esm=t.options.emitESM,e.cjs=!1):e.cjs===void 0&&e.esm===void 0&&(t.options.emitCJS!==void 0&&(e.cjs=t.options.emitCJS),t.options.emitESM!==void 0&&(e.esm=t.options.emitESM)),e.outDir=P(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),Jp=bn(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:zt(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:zt(t.input)});for(const t of e.options.entries.filter(i=>i.isGlob)){const{isGlob:i,...n}=t,o=["**/.git/**","**/node_modules/**","**/test-results/**"];if(e.options.rollup.watch){if(typeof e.options.rollup.watch.exclude=="string")o.push(e.options.rollup.watch.exclude);else if(Array.isArray(e.options.rollup.watch.exclude))for(const s of e.options.rollup.watch.exclude)typeof s=="string"&&o.push(s)}const a=lo([n.input],{cwd:e.options.rootDir,dot:!1,ignore:o,onlyFiles:!0});if(a.length===0)throw new Mo("No files found in the glob pattern: "+D($(e.options.rootDir,n.input)));for(const s of a)e.options.entries.push({...n,input:P(e.options.rootDir,s)});e.options.entries.splice(e.options.entries.indexOf(t),1)}for(const t of e.options.entries.filter(i=>i.fileAlias===void 0))await gi(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await gi(t,e)},"prepareEntries");var qp=Object.defineProperty,Wp=g((e,t)=>qp(e,"name",{value:t,configurable:!0}),"a$5");const Up=Wp(async(e,t,i)=>{if(e&&await Ge($(e,"keystore.json"))){const n=await wi($(e,"keystore.json"));let o=await Yn(e,{withFileTypes:!0});o=o.filter(s=>s.isDirectory());let a=i;for(const s of o)if(!n[s.name]){try{await Xn($(e,s.name),{force:!0,recursive:!0})}catch(r){t.error({message:`Failed to remove cache directory ${s.name}: ${r instanceof Error?r.message:String(r)}`,prefix:"file-cache"});continue}a&&t.raw(`
|
|
132
132
|
|
|
133
|
-
`),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var
|
|
134
|
-
- `+D(p)+(l.length>0?
|
|
135
|
-
`),e.logger.warn({message:c,prefix:"validation:file-size"})):C(e,c)}}if(o){const s=e.buildEntries.reduce((p,l)=>{const c=l.size?.bytes;return p+(typeof c=="number"?c:0)},0),r=typeof o=="string"?
|
|
136
|
-
`),e.logger.warn({message:p,prefix:"validation:file-size"})):C(e,p)}}},"validateBundleSize");var
|
|
133
|
+
`),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var Vp=Object.defineProperty,Kp=g((e,t)=>Vp(e,"name",{value:t,configurable:!0}),"a$4");const Gp=Kp((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var Hp=Object.defineProperty,Yp=g((e,t)=>Hp(e,"name",{value:t,configurable:!0}),"a$3");const Xp=Yp((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var Qp=Object.defineProperty,Zp=g((e,t)=>Qp(e,"name",{value:t,configurable:!0}),"p");const ec=Zp(e=>{if(e.options.validation.packageJson?.dependencies===!1)return;const t=new Set,i=new Set(Object.keys(e.pkg?.dependencies??{})),n=new Set;for(const o of e.usedImports)i.delete(o),t.add(o);if(e.pkg?.dependencies)for(const o of Object.keys(e.pkg?.dependencies))i.delete(o);for(const o of t){const a=Xp(o);!Gp(e.options.externals,o)&&!o.startsWith("chunks/")&&![...Rt.builtinModules,...Rt.builtinModules.map(s=>`node:${s}`)].includes(a)&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&e.pkg.peerDependenciesMeta?.[a]?.optional!==!0&&n.add(o)}i.size>0&&C(e,`Potential unused dependencies found: ${[...i].map(o=>D(o)).join(", ")}`),n.size>0&&C(e,`Potential implicit dependencies found: ${[...n].map(o=>D(o)).join(", ")}`)},"validateDependencies");var tc=Object.defineProperty,wn=g((e,t)=>tc(e,"name",{value:t,configurable:!0}),"i$1");const ic=wn((e,t)=>_o(e,t)<=e.length/3||t.includes(e),"isSimilar"),nc=wn((e,t)=>{const i=e.toLowerCase();return t.filter(n=>ic(n.toLowerCase(),i))},"findAlternatives");var oc=Object.defineProperty,hi=g((e,t)=>oc(e,"name",{value:t,configurable:!0}),"t");const ac=hi(e=>{const{options:t}=e,i=t.validation;if(i.packageJson?.exports===!1)return;const n=new Set([t.declaration&&i.packageJson?.types?e.pkg.types:"",t.declaration&&i.packageJson?.types?e.pkg.typings:"",...t.dtsOnly||i.packageJson?.bin===!1?[""]:typeof e.pkg.bin=="string"?[e.pkg.bin]:Object.values(e.pkg.bin??{}),t.dtsOnly&&i.packageJson?.main===!1?"":e.pkg.main,t.dtsOnly&&i.packageJson?.module===!1?"":e.pkg.module,...i.packageJson?.exports?Dt(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(r=>t.dtsOnly?r.subKey==="types"?r.file:void 0:r.file):[]].filter(Boolean).map(r=>r&&P(t.rootDir,r.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),o=[];for(const r of n)r&&!r.includes("*")&&!Eo(r)&&o.push(r.replace(`${t.rootDir}/`,""));const a=hi(r=>I(t.rootDir,P(t.outDir,r)),"rPath"),s=e.buildEntries.filter(r=>!r.chunk).map(r=>a(r.path));if(o.length>0){let r="Potential missing or wrong package.json files:";for(const p of o){const l=nc(p,s);r+=`
|
|
134
|
+
- `+D(p)+(l.length>0?Fn` (did you mean ${l.map(c=>`"${c}"`).join(", ")}?)`:"")}C(e,r)}},"validatePackageEntries");var sc=Object.defineProperty,rc=g((e,t)=>sc(e,"name",{value:t,configurable:!0}),"l$1");const lc=rc(e=>{const t=e.options.validation,{pkg:i}=e;i.name===void 0&&t?.packageJson?.name!==!1&&C(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),t?.packageJson?.files!==!1&&Array.isArray(i.files)&&!i.files.includes("*")&&(i.files.length===0?C(e,"The 'files' field in your package.json is empty. Please specify the files to be included in the package."):i.files.some(a=>a.includes(e.options.outDir))||C(e,`The 'files' field in your package.json is missing the '${e.options.outDir}' directory. Ensure the output directory is included.`));const n=i.type==="commonjs"||i.type===void 0,o=i.type==="module";if(n?(t?.packageJson?.main!==!1&&(i.main===void 0&&C(e,"The 'main' field is missing in your package.json. This field should point to your main entry file."),i.main?.includes(".mjs")&&C(e,"The 'main' field in your package.json should not use a '.mjs' extension for CommonJS modules.")),t?.packageJson?.module!==!1&&(i.module===void 0&&e.options.emitESM&&C(e,"The 'module' field is missing in your package.json, but you are emitting ES modules."),i.module&&i.main&&i.module===i.main&&C(e,`Conflict detected: The 'module' and 'main' fields both point to '${i.module}'. Please ensure they refer to different module types.`),e.options.emitESM&&i.module?.includes(".cjs")&&C(e,"The 'module' field in your package.json should not use a '.cjs' extension for ES modules."))):o&&(i.exports===void 0&&!e.options.emitCJS?t?.packageJson?.exports!==!1&&C(e,"The 'exports' field is missing in your package.json. Define module exports explicitly."):e.options.emitCJS&&(t?.packageJson?.main!==!1&&i.main===void 0&&C(e,"The 'main' field is missing in your package.json. This field is needed when emitting CommonJS modules."),t?.packageJson?.module!==!1&&(i.module===void 0&&C(e,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),i.module?.includes(".cjs")&&C(e,"The 'module' field should not use a '.cjs' extension for ES modules."),i.module&&i.main&&i.module===i.main&&C(e,`Conflict detected: The 'module' and 'main' fields both point to '${i.module}'. Please ensure they refer to different module types.`)),t?.packageJson?.exports!==!1&&i.exports===void 0&&C(e,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports."))),t?.packageJson?.bin!==!1){if(typeof i.bin=="string"&&i.bin.includes(n?".mjs":".cjs"))C(e,`The 'bin' field in your package.json should not use a ${n?".mjs":".cjs"} extension for ${n?"CommonJS":"ES modules"} binaries.`);else if(typeof i.bin=="object")for(const[a,s]of Object.entries(i.bin))s&&s.includes(n?".mjs":".cjs")&&C(e,`The 'bin.${a}' field in your package.json should not use a ${n?".mjs":".cjs"} extension for ${n?"CommonJS":"ES modules"} binaries.`)}if(e.options.declaration){let a=!0;i.type==="module"&&(a=!!i.main?.endsWith(".cjs")),i.types===void 0&&i.typings===void 0&&a&&t?.packageJson?.types!==!1&&C(e,"The 'types' field is missing in your package.json. This field should point to your type definitions file."),(e.options.declaration===!0||e.options.declaration==="compatible")&&a&&t?.packageJson?.typesVersions!==!1&&(i.typesVersions===void 0||Object.keys(i.typesVersions).length===0)&&C(e,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")}},"validatePackageFields");var pc=Object.defineProperty,cc=g((e,t)=>pc(e,"name",{value:t,configurable:!0}),"i");const dc=cc(e=>{const{packageJson:t}=yn(e.options.rootDir);e.pkg=t,ec(e),lc(e),ac(e)},"validator");var uc=Object.defineProperty,mc=g((e,t)=>uc(e,"name",{value:t,configurable:!0}),"a$1");const fc=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,gc=new Set(["abstract","await","boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with","yield"]),vi=mc(e=>{if(!Array.isArray(e)&&e!==null)for(const[t,i]of Object.entries(e)){if(typeof t!="string"||t.trim()==="")throw new Error(`Alias name "${t}" is invalid. Alias names should be non-empty strings.`);if(fc.test(t))throw new Error(`Alias name "${t}" is invalid. Alias names should start with a letter or underscore and only contain letters, numbers, underscores, and dashes.`);if(gc.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const n=P(i);if(!L(n))throw new Error(`Target path "${n}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var hc=Object.defineProperty,vc=g((e,t)=>hc(e,"name",{value:t,configurable:!0}),"d");const xc=vc((e,t)=>{const i=e.options.validation,{allowFail:n=!1,limit:o,limits:a={}}=i.bundleLimit??{};for(const[s,r]of Object.entries(a)){const p=typeof r=="string"?_t(r):r;if(!Number.isFinite(p)||p<=0){e.logger.debug({message:`Invalid limit for ${s}: ${r}`,prefix:"Validation: File Size"});continue}const l=e.buildEntries.find(c=>{const u=s.replace(new RegExp(`^.?/?${e.options.outDir}/?`),"");return c.path.endsWith(u)||To(s)(c.path)});if(!l?.size?.bytes){e.logger.debug({message:l?`Entry file has no size information: ${s}.`:`Entry file not found: ${s}, please check your configuration.`,prefix:"Validation: File Size"});continue}if(l.size.bytes>p){const c=`File size exceeds the limit: ${$(e.options.outDir,l.path)} (${R(l.size.bytes)} / ${R(p,{decimals:2})})`;n?(t&&e.logger.raw(`
|
|
135
|
+
`),e.logger.warn({message:c,prefix:"validation:file-size"})):C(e,c)}}if(o){const s=e.buildEntries.reduce((p,l)=>{const c=l.size?.bytes;return p+(typeof c=="number"?c:0)},0),r=typeof o=="string"?_t(o):o;if(!Number.isFinite(r)||r<=0){e.logger.debug({message:`Invalid total limit: ${o}`,prefix:"Validation: File Size"});return}if(s>r){const p=`Total file size exceeds the limit: ${R(s)} / ${R(r,{decimals:2})}`;n?(t&&Object.keys(a).length===0&&e.logger.raw(`
|
|
136
|
+
`),e.logger.warn({message:p,prefix:"validation:file-size"})):C(e,p)}}},"validateBundleSize");var yc=Object.defineProperty,W=g((e,t)=>yc(e,"name",{value:t,configurable:!0}),"c");const bc=W(e=>{switch(e){case"preserve":case"react-native":return"preserve";case"react":return"transform";case"react-jsx":case"react-jsxdev":return"automatic";default:return}},"resolveTsconfigJsxToJsxRuntime"),wc=W((e,t,i,n,o,a,s,r,p,l)=>{const c=bc(p?.config.compilerOptions?.jsx),u=l.split("."),d=Wn(a,o,s,{alias:{},browserTargets:qn(),cjsInterop:!1,clean:!0,debug:n,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:n,interopDefault:!0},minify:i===oe,name:(r.name??"").split("/").pop()??"default",outDir:p?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!0},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dts:{compilerOptions:{baseUrl:p?.config.compilerOptions?.baseUrl??".",checkJs:!1,composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,moduleResolution:100,noEmit:!1,noEmitOnError:!0,preserveSymlinks:!1,skipLibCheck:!0,target:99},respectExternal:!0},dynamicVars:{errorWhenNoFilesFound:!0,exclude:ye,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:c,jsxDev:p?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:p?.config.compilerOptions?.jsxFactory,jsxFragment:p?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:p?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:p?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:p?.config},experimental:{resolve:{aliasFields:[["browser"]],builtinModules:!1,conditionNames:["default","types","import","require","module-sync","node","node-addons","browser","esm2020","es2020","es2015"],extensionAlias:{".cjs":[".cts",".d.cts",".cjs"],".js":[".ts",".tsx",".d.ts",".js"],".jsx":[".tsx",".d.ts",".jsx"],".mjs":[".mts",".d.mts",".mjs"]},extensions:[".ts",".tsx",".d.ts",".js",".jsx",".json",".node"],mainFields:["types","typings","fesm2020","fesm2015","esm2020","es2020","main","module","browser","jsnext:main"]}},isolatedDeclarations:{exclude:ye,ignoreErrors:!1,include:be},json:{preferConst:!0},license:{dependenciesTemplate:W((v,h,x)=>`
|
|
137
137
|
# Licenses of bundled dependencies
|
|
138
138
|
The published ${x} artifact additionally contains code with the following licenses:
|
|
139
139
|
`+(v.length>0?`${v.join(", ")}
|
|
@@ -147,16 +147,16 @@ The published ${x} artifact additionally contains code with the following licens
|
|
|
147
147
|
|
|
148
148
|
`:`
|
|
149
149
|
`)+`# Bundled types:
|
|
150
|
-
`+h,"dtsTemplate")},node10Compatibility:{},output:{importAttributesKey:Number(u[0])>=22?"with":"assert"},patchTypes:{},polyfillNode:{},preserveDirectives:{include:be},preserveDynamicImports:!0,raw:{exclude:ye,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:[i??"production","module-sync"],extensions:Ye,preferBuiltins:!1},resolveExternals:{builtins:!0,builtinsPrefix:"add",deps:!0,devDeps:!1,exclude:[],optDeps:!0,peerDeps:!0},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:ye,include:be},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:p?.config.compilerOptions?.esModuleInterop===!1,include:be,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===oe,...p?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(p.config.compilerOptions.jsx)?{jsxFragmentPragma:p.config.compilerOptions.jsxFragmentFactory,jsxImportSource:p.config.compilerOptions.jsxImportSource,jsxPragma:p.config.compilerOptions.jsxFactory,jsxRuntime:c,transforms:["typescript","jsx",...p.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...p?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:be,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:p?.config.compilerOptions?.experimentalDecorators,syntax:p?"typescript":"ecmascript",[p?"tsx":"jsx"]:!0},target:p?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:p?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:p?.config.compilerOptions?.experimentalDecorators,react:{development:i!==oe,pragma:p?.config.compilerOptions?.jsxFactory,pragmaFrag:p?.config.compilerOptions?.jsxFragmentFactory,runtime:c,throwIfNamespace:!0},treatConstEnumAsEnum:p?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:p?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:
|
|
150
|
+
`+h,"dtsTemplate")},node10Compatibility:{},output:{importAttributesKey:Number(u[0])>=22?"with":"assert"},patchTypes:{},polyfillNode:{},preserveDirectives:{include:be},preserveDynamicImports:!0,raw:{exclude:ye,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:[i??"production","module-sync"],extensions:Ye,preferBuiltins:!1},resolveExternals:{builtins:!0,builtinsPrefix:"add",deps:!0,devDeps:!1,exclude:[],optDeps:!0,peerDeps:!0},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:ye,include:be},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:p?.config.compilerOptions?.esModuleInterop===!1,include:be,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===oe,...p?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(p.config.compilerOptions.jsx)?{jsxFragmentPragma:p.config.compilerOptions.jsxFragmentFactory,jsxImportSource:p.config.compilerOptions.jsxImportSource,jsxPragma:p.config.compilerOptions.jsxFactory,jsxRuntime:c,transforms:["typescript","jsx",...p.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...p?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:be,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:p?.config.compilerOptions?.experimentalDecorators,syntax:p?"typescript":"ecmascript",[p?"tsx":"jsx"]:!0},target:p?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:p?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:p?.config.compilerOptions?.experimentalDecorators,react:{development:i!==oe,pragma:p?.config.compilerOptions?.jsxFactory,pragmaFrag:p?.config.compilerOptions?.jsxFragmentFactory,runtime:c,throwIfNamespace:!0},treatConstEnumAsEnum:p?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:p?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:Cp(t,r),preset:"recommended",propertyReadSideEffects:!0},tsconfigPaths:{resolveAbsolutePath:!1},url:{emitFiles:!0,fileName:"[hash][extname]",include:["**/*.svg","**/*.png","**/*.jp(e)?g","**/*.gif","**/*.webp"],limit:14*1024},visualizer:{},watch:{chokidar:{ignoreInitial:!0,ignorePermissionErrors:!0},clearScreen:!0,exclude:ye}},rootDir:t,sourceDir:"src",sourcemap:!1,transformerName:void 0,typedoc:{excludePrivate:!0,format:"inline",githubPages:!1,groupOrder:["Classes","Constructors","Accessors","Methods","Functions","Namespaces","Variables","Enumerations","Interfaces","Type Aliases","*"],kindSortOrder:["Project","Module","Class","Interface","Function","Namespace","Variable","Enum","EnumMember","TypeAlias","Reference","Constructor","Property","Accessor","Method","Parameter","TypeParameter","TypeLiteral","CallSignature","ConstructorSignature","IndexSignature","GetSignature","SetSignature"],marker:"TYPEDOC",name:r.name??"unknown",pretty:!0,readme:"none",showConfig:n,tsconfig:p?.path}});d.runtime===void 0&&(e.warn("No runtime specified, defaulting to 'node'. This will change in packem v2 to 'browser', please add 'runtime: node' to your packem config or command call"),d.runtime="node");let m="0.0.0";if(d.transformer?.NAME!==void 0)d.transformerName=d.transformer.NAME;else if(!d.transformerName){const v=new Map([...Object.entries(r.dependencies??{}),...Object.entries(r.devDependencies??{})]);if(v.has("esbuild"))d.transformerName="esbuild",m=v.get("esbuild");else if(v.has("@swc/core"))d.transformerName="swc",m=v.get("@swc/core");else if(v.has("sucrase"))d.transformerName="sucrase",m=v.get("sucrase");else throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase")}return e.info({message:"Using "+D("node ")+l,prefix:"system"}),e.info({message:"Using "+D("rollup ")+Vn+" with "+D(d.runtime)+" build runtime",prefix:"bundler"}),e.info({message:"Using "+D(d.transformerName)+" "+m,prefix:"transformer"}),d.rollup.resolve&&(d.rollup.resolve.preferBuiltins=d.runtime==="node",d.rollup.resolve.preferBuiltins&&(d.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true"))),d.runtime==="node"&&(d.browserTargets=[]),d.runtime==="browser"&&d.browserTargets&&d.browserTargets.length>0&&e.debug("Using browser targets: "+d.browserTargets.join(", ")),vi(d.alias),d.rollup.alias&&d.rollup.alias.entries&&vi(d.rollup.alias.entries),d},"generateOptions"),kc=W(async(e,t,i,n,o,a,s,r,p,l,c)=>{const u=await cp(s.preset??a.preset??"auto",l),d=wc(e,t,n,o,a,s,u,r,p,c);zn($(d.rootDir,d.outDir));const m={buildEntries:[],dependencyGraphMap:new Map,environment:n,hooks:Un(),jiti:ji(d.rootDir,d.jiti),logger:e,mode:i,options:d,pkg:r,tsconfig:p,usedImports:new Set,warnings:new Set};u.hooks&&m.hooks.addHooks(u.hooks),a.hooks&&m.hooks.addHooks(a.hooks),s.hooks&&m.hooks.addHooks(s.hooks),await m.hooks.callHook("build:prepare",m),m.options.emitESM===void 0&&m.logger.info("Emitting of ESM bundles, is disabled."),m.options.emitCJS===void 0&&m.logger.info("Emitting of CJS bundles, is disabled."),m.options.minify&&m.logger.info("Minification is enabled, the output will be minified");const v=ki(r,["typescript"]);if(m.options.declaration&&m.tsconfig===void 0&&v)throw new Error("Cannot build declaration files without a tsconfig.json");return v?m.options.declaration===!1&&m.logger.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(m.options.declaration=!1,m.logger.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),m.options.declaration&&m.logger.info("Using typescript version: "+D(r.devDependencies?.typescript??r.dependencies?.typescript??"unknown")),m.options.declaration&&(r.dependencies?.typescript||r.devDependencies?.typescript)&&!m.tsconfig?.config.compilerOptions?.isolatedModules&&m.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
|
|
151
151
|
Because none of the third-party transpiler, packem uses under the hood is type-aware, some techniques or features often used in TypeScript are not properly checked and can cause mis-compilation or even runtime errors.
|
|
152
|
-
To mitigate this, you should set the isolatedModules option to true in tsconfig and let your IDE warn you when such incompatible constructs are used.`),await
|
|
153
|
-
${K("Entries:")}`}),await
|
|
154
|
-
`),await w.hooks.callHook("builder:before",O,w);const E=Date.now(),
|
|
155
|
-
⚡️ `+O+" run in "+
|
|
152
|
+
To mitigate this, you should set the isolatedModules option to true in tsconfig and let your IDE warn you when such incompatible constructs are used.`),await Jp(m),m},"createContext"),jc=W(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";case"build":return"Building";default:throw new Error("Unknown mode: "+e)}},"getMode"),$c=W(async(e,t,i,n,o={})=>{const{configPath:a,debug:s,tsconfigPath:r,...p}=o,l=Ie.version.slice(1);n.wrapAll(),e=P(Ie.cwd(),e),n.debug("Root directory:",e);const{packageJson:c,packageJsonPath:u}=yn(e);n.debug("Using package.json found at",u);let d;if(r){const f=$(e,r);if(!await Ge(f))throw new Error("tsconfig.json not found at "+f);d={config:Bn(f),path:f},n.info("Using tsconfig settings at",f)}else if(ki(c,["typescript"]))try{d=await Jn(e),n.debug("Using tsconfig settings found at",d.path)}catch{n.info("No tsconfig.json or jsconfig.json found.")}const m=Ln("@visulima/packem",{cwd:e});let v=!1,h,x;try{const f=await _i(e,a??""),k=ji(e,{debug:s});let b=await k.import(f,{default:!0,try:!0})||{};typeof b=="function"&&(b=await b(i,t)),n.debug("Using packem config found at",$(e,f));const y=ne(JSON.stringify({version:c.version,...c.dependencies,...c.devDependencies,...c.peerDependencies,...c.peerDependenciesMeta,browser:c.browser,eNode:c.engines?.node,exports:c.exports,main:c.main,module:c.module,nodeVersion:l,type:c.type,types:c.types}))+ne(JSON.stringify(b));m&&$p(y,m,n);const j=new Op(e,m,y,n),w=await kc(n,e,t,i,s??!1,p,b,c,d,k,l);j.isEnabled=w.options.fileCache,w.logger.info(D(jc(t)+" "+w.options.name)),w.logger.debug({context:w.options.entries,message:`${K("Root dir:")} ${w.options.rootDir}
|
|
153
|
+
${K("Entries:")}`}),await wp(w);const S=W(async z=>{for await(const[O,T]of Object.entries(w.options.builder??{})){w.logger.raw(`
|
|
154
|
+
`),await w.hooks.callHook("builder:before",O,w);const E=Date.now(),B=W(()=>Tt(Math.floor(Date.now()-E)),"getBuilderDuration");await T(w,m,j,v),await w.hooks.callHook("builder:done",O,w),w.logger.raw(`
|
|
155
|
+
⚡️ `+O+" run in "+B()),z&&w.logger.raw(`
|
|
156
156
|
|
|
157
|
-
`)}},"runBuilder"),N=W(async()=>{if(h!==void 0)await
|
|
157
|
+
`)}},"runBuilder"),N=W(async()=>{if(h!==void 0)await zp({pid:h.pid,signal:p.killSignal??b.killSignal??"SIGTERM"});else if(x!==void 0)try{await x()}catch(z){throw new Error("onSuccess function cleanup failed: "+z.message,{cause:z})}h=void 0,x=void 0},"doOnSuccessCleanup"),M=W(async()=>{if(typeof w.options.onSuccess=="function")try{x=await w.options.onSuccess()}catch(z){throw new Error("onSuccess function failed: "+z.message,{cause:z})}else if(typeof w.options.onSuccess=="string"){const z=w.options.onSuccessTimeout??3e4;if(h=Kn(w.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:z}}),await h,h.exitCode&&h.exitCode!==0)throw new Error("onSuccess script failed with exit code "+h.exitCode+". Check the output above for details.")}},"runOnsuccess"),X=Date.now(),Q=W(()=>Tt(Math.floor(Date.now()-X)),"getDuration");if(t==="watch"){if(w.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem.config file.");await xp(w,j,S,M,N),fi(w,!1);return}t==="jit"?(await mp(w),await w.hooks.callHook("build:done",w)):(v=await Vl(w,j),await w.hooks.callHook("validate:before",w),w.options.validation!==!1&&(dc(w),xc(w,v)),await w.hooks.callHook("validate:done",w),fi(w,v)),w.logger.raw(`
|
|
158
158
|
⚡️ Build run in `+Q()),await S(),await M(),Ie.on("SIGINT",async()=>{await N()}),Ie.on("SIGTERM",async()=>{await N()})}catch(f){throw n.raw(`
|
|
159
|
-
`),gn(f),f}finally{n.restoreAll(),await
|
|
159
|
+
`),gn(f),f}finally{n.restoreAll(),await Up(m,n,v)}},"packem");var Ec=Object.defineProperty,ke=g((e,t)=>Ec(e,"name",{value:t,configurable:!0}),"a");const Sc=ke(e=>{e.addCommand({description:"Demonstrate options required",execute:ke(async({logger:t,options:i})=>{let n="build";i.watch?n="watch":i.jit&&(n="jit");const o={};let a;if(i.env)for(const r of i.env)r.key==="NODE_ENV"?a=r.value:o["process.env."+r.key]=JSON.stringify(r.value);a===void 0&&(i.production?a=oe:i.development&&(a=Je));const s=[];if(i.external)for(const r of i.external)s.push(r.split(","));try{await $c(i.dir,n,a,t,{analyze:i.analyze,cjsInterop:i.cjsInterop,clean:i.clean,configPath:i.config??void 0,debug:i.debug,dtsOnly:i.dtsOnly,externals:s,killSignal:i.killSignal,minify:i.minify===void 0?a===oe:i.minify,onSuccess:i.onSuccess,rollup:{esbuild:{target:i.target},license:{path:i.license},metafile:i.metafile,replace:{values:o},resolveExternals:i.noExternal?{builtins:!1,deps:!1,devDeps:!1,optDeps:!1,peerDeps:!1}:{}},runtime:i.runtime,sourcemap:i.metafile||i.analyze||i.sourcemap,tsconfigPath:i.tsconfig??void 0,validation:i.validation,...i.typedoc?{typedoc:{format:"html"}}:{}})}catch(r){t.error(r),Pn(1)}},"execute"),name:"build",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{alias:"t",description:"Environments to support. `target` in tsconfig.json is automatically added. Defaults to the current Node.js version.",name:"target"},{description:"Use a custom config file",name:"config",type:String},{description:"Path to the tsconfig.json file",name:"tsconfig",type:String},{description:"Minify the output",name:"minify",type:Boolean},{description:"Generate sourcemaps (experimental)",name:"sourcemap",type:Boolean},{conflicts:"jit",description:"Watch for changes",name:"watch",type:Boolean},{conflicts:"watch",description:"Stub the package for JIT compilation",name:"jit",type:Boolean},{description:"Compile-time environment variables (eg. --env.NODE_ENV=production)",multiple:!0,name:"env",type:ke(t=>{const[i,n]=t.split("=");return{key:i,value:n}},"type")},{defaultValue:!1,description:"Generate meta file (experimental)",name:"metafile",type:Boolean},{description:"Path to the license file",name:"license",type:String},{conflicts:"watch",description:"Visualize and analyze the bundle",name:"analyze",type:Boolean},{description:"CJS interop mode, can export default and named export, (experimental).",name:"cjsInterop",type:Boolean},{conflicts:"development",description:"Run code in production environment",name:"production",type:Boolean},{conflicts:"production",description:"Run code in development environment",name:"development",type:Boolean},{description:"Do not clean the dist directory before building",name:"no-clean",type:Boolean},{description:"Only generate .d.ts files",name:"dts-only",type:Boolean},{description:"Enable or disable the output validation",name:"no-validation",type:Boolean},{description:"Generate type documentation",name:"typedoc",type:Boolean},{description:"Execute command after successful build, specially useful for watch mode",name:"onSuccess",type:String},{description:'Signal to kill child process, "SIGTERM" or "SIGKILL"',name:"killSignal",type:ke(t=>{if(t==="SIGTERM"||t==="SIGKILL")return t;throw new Error("Invalid kill signal. Use 'SIGTERM' or 'SIGKILL'.")},"type")},{description:"Specify an external dependency, separate by comma (eg. --external lodash,react,react-dom)",multiple:!0,name:"external",typeLabel:"string[]"},{description:"do not bundle external dependencies",name:"no-external",type:Boolean},{description:"Specify the build runtime (nodejs, browser).",name:"runtime",type:ke(t=>{if(t==="node"||t==="browser")return t;throw new Error("Invalid runtime. Use 'node' or 'browser'.")},"type")}]})},"createBuildCommand");var Oc=Object.defineProperty,je=g((e,t)=>Oc(e,"name",{value:t,configurable:!0}),"f");const Pc=je(e=>{e.addCommand({description:"Initialize packem configuration",execute:je(async({logger:t,options:i})=>{if(Dn("Welcome to packem setup"),L($(i.dir,"packem.config.ts"))){t.info("Packem project already initialized, you can use `packem build` to build your project");return}const n=P(xi(),i.dir??"."),o=$(n,"package.json");if(!L(o))throw new Error("No package.json found in the directory");const a=Mi(o),s=[];a.dependencies&&s.push(...Object.keys(a.dependencies)),a.devDependencies&&s.push(...Object.keys(a.devDependencies));const r=!!(a.devDependencies?.typescript??a.dependencies?.typescript),p=[];if(i.typescript===void 0&&!r?(i.typescript=await V({message:"Do you want to install TypeScript?"}),i.typescript&&p.push("typescript@latest")):Nt.message("TypeScript version "+(a.devDependencies?.typescript??a.dependencies?.typescript)+" is already installed"),!L($(n,"tsconfig.json"))){const h=await V({message:"Do you want to use generate a tsconfig.json?"}),x=await V({message:"Do you want to run your code in the DOM?"});if(h){const f=ut();f.start("Generating tsconfig.json"),wt($(n,"tsconfig.json"),{compilerOptions:{esModuleInterop:!0,skipLibCheck:!0,target:"es2022",allowJs:!0,resolveJsonModule:!0,moduleDetection:"force",isolatedModules:!0,verbatimModuleSyntax:!0,strict:!0,noUncheckedIndexedAccess:!0,noImplicitOverride:!0,module:"NodeNext",outDir:"dist",sourceMap:!0,declaration:!0,lib:x?["es2022","dom","dom.iterable"]:["es2022"]}}),f.stop("")}}if(i.runtime===void 0&&(i.runtime=await Z({message:"Pick a build runtime",options:[{label:"Node",value:"node"},{label:"Browser",value:"browser"}]})),s.includes("esbuild")?i.transformer="esbuild":s.includes("@swc/core")?i.transformer="swc":s.includes("sucrase")&&(i.transformer="sucrase"),i.transformer===void 0?(i.transformer=await Z({message:"Pick a transformer",options:[{label:"esbuild",value:"esbuild"},{label:"swc",value:"swc"},{label:"Sucrase",value:"sucrase"}]}),i.transformer&&!s.includes(i.transformer)&&await V({message:"Do you want to install "+i.transformer+"?"})&&p.push(i.transformer==="swc"?"@swc/core":i.transformer)):Nt.message("Transformer "+i.transformer+" is already installed."),i.isolatedDeclarationTransformer===void 0&&(i.isolatedDeclarationTransformer=await V({message:"Do you want to use an isolated declaration types?",initialValue:!1})),i.isolatedDeclarationTransformer===void 0&&(i.isolatedDeclarationTransformer=await Z({message:"Pick a isolated declaration transformer",options:[{label:"Typescript",value:"typescript"},{label:"swc",value:"swc"},{label:"OXC",value:"oxc"},{label:"None",value:null}]}),i.isolatedDeclarationTransformer!==null)){let h;switch(i.isolatedDeclarationTransformer){case"typescript":{h="typescript";break}case"swc":{h="@swc/core";break}case"oxc":{h="oxc-transform";break}default:Cn("Invalid isolated declaration transformer")}h!==void 0&&!s.includes(h)&&await V({message:"Do you want to install "+h+"?"})&&p.push(h)}i.css===void 0&&(i.css=await V({message:"Do you want to use css in your project?",initialValue:!1}));const l=[];if(i.css){const h=await Z({message:"Pick a css loader",options:[{label:"PostCSS",value:"postcss"},{hint:"experimental",label:"Lightning CSS",value:"lightningcss"}]});l.push(h);let x=await yi({message:"Pick your loaders",options:[{label:"Sass",value:"sass"},{label:"Stylus",value:"stylus"},{label:"Less",value:"less"}],required:!1});if(x.includes("sass")){const f=await Z({message:"Pick a sass loader",options:[{label:"Sass embedded",value:"sass-embedded",hint:"recommended"},{label:"Sass",value:"sass"},{label:"Node Sass",value:"node-sass",hint:"legacy"}]});f!=="sass"&&(x=x.filter(k=>k!=="sass"),x.push(f))}if(l.push(...x),await V({message:'Do you want to install "'+l.join('", "')+'"?'}))for(const f of l)p.push(...Ti[f]);l.push("sourceMap")}i.cssMinifier===void 0&&(i.cssMinifier=await V({message:"Do you want to minify your css?",initialValue:!1}));let c;i.cssMinifier&&(c=await Z({message:"Pick a css minifier",options:[{label:"CSSNano",value:"cssnano"},{label:"Lightning CSS",value:"lightningcss"}]}),l.includes("lightningcss")||await V({message:'Do you want to install "'+c+'"?'})&&p.push(c));let u="",d="";if(i.isolatedDeclarationTransformer&&(d+=`,
|
|
160
160
|
isolatedDeclarationTransformer`),(i.css||i.cssMinifier)&&(d+=`,
|
|
161
161
|
rollup: {
|
|
162
162
|
css: {`),i.css){const h=l.map(x=>((x==="sass-embedded"||x==="node-sass")&&(x="sass"),`${x}Loader`)).join(", ");d+=`
|
|
@@ -183,4 +183,4 @@ module.exports = defineConfig({
|
|
|
183
183
|
runtime: ${i.runtime},
|
|
184
184
|
transformer${d}
|
|
185
185
|
});
|
|
186
|
-
`}const m=ut(),v=r?"ts":"js";p.length>0&&(m.start("Installing packages"),await dt(p,{cwd:n,dev:!0,silent:!0}),m.stop("Installed packages")),m.start("Creating packem.config."+v),ce($(n,"packem.config."+v),u),m.stop("Created packem.config."+v),Nn("Now you can run `packem build` to build your project")},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer",name:"transformer",type:je(t=>{if(typeof t=="string"&&["esbuild","sucrase","swc"].includes(t))return t;throw new Error("Invalid transformer, please choose one of 'swc', 'sucrase' or 'esbuild'")},"type")},{description:"Choose a isolated declaration transformer",name:"isolated-declaration-transformer",type:je(t=>{if(typeof t=="string"&&["none","oxc","swc","typescript"].includes(t))return t;throw new Error("Invalid isolated declaration isolated declaration, please choose one of 'none', 'oxc', 'swc' or 'typescript'")},"type")},{description:"Use CSS",name:"css",type:Boolean},{description:"Use CSS minifier",name:"css-minifier",type:Boolean},{Description:"Use TypeScript",name:"typescript",type:Boolean},{description:"Specify the build runtime (nodejs, browser).",name:"runtime",type:je(t=>{if(t==="node"||t==="browser")return t;throw new Error("Invalid runtime. Use 'node' or 'browser'.")},"type")}]})},"createInitCommand");try{require("node:module")?.enableCompileCache?.()||require("v8-compile-cache")}catch{}const it=new $n("packem",{logger:{reporters:[new En({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"},packageName:
|
|
186
|
+
`}const m=ut(),v=r?"ts":"js";p.length>0&&(m.start("Installing packages"),await dt(p,{cwd:n,dev:!0,silent:!0}),m.stop("Installed packages")),m.start("Creating packem.config."+v),ce($(n,"packem.config."+v),u),m.stop("Created packem.config."+v),Nn("Now you can run `packem build` to build your project")},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer",name:"transformer",type:je(t=>{if(typeof t=="string"&&["esbuild","sucrase","swc"].includes(t))return t;throw new Error("Invalid transformer, please choose one of 'swc', 'sucrase' or 'esbuild'")},"type")},{description:"Choose a isolated declaration transformer",name:"isolated-declaration-transformer",type:je(t=>{if(typeof t=="string"&&["none","oxc","swc","typescript"].includes(t))return t;throw new Error("Invalid isolated declaration isolated declaration, please choose one of 'none', 'oxc', 'swc' or 'typescript'")},"type")},{description:"Use CSS",name:"css",type:Boolean},{description:"Use CSS minifier",name:"css-minifier",type:Boolean},{Description:"Use TypeScript",name:"typescript",type:Boolean},{description:"Specify the build runtime (nodejs, browser).",name:"runtime",type:je(t=>{if(t==="node"||t==="browser")return t;throw new Error("Invalid runtime. Use 'node' or 'browser'.")},"type")}]})},"createInitCommand");try{require("node:module")?.enableCompileCache?.()||require("v8-compile-cache")}catch{}const it=new $n("packem",{logger:{reporters:[new En({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"},packageName:Io,packageVersion:zo});Pc(it);Sc(it);Bo(it);it.run({shouldExitProcess:!1});
|