@visulima/packem 1.6.3 → 1.6.5

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/builder/typedoc/index.cjs +2 -2
  3. package/dist/builder/typedoc/index.d.cts +2 -2
  4. package/dist/builder/typedoc/index.d.mts +2 -2
  5. package/dist/builder/typedoc/index.d.ts +2 -2
  6. package/dist/builder/typedoc/index.mjs +3 -3
  7. package/dist/cli.mjs +66 -66
  8. package/dist/config.d.cts +3 -3
  9. package/dist/config.d.mts +3 -3
  10. package/dist/config.d.ts +3 -3
  11. package/dist/packem.cjs +34 -34
  12. package/dist/packem.d.cts +3 -3
  13. package/dist/packem.d.mts +3 -3
  14. package/dist/packem.d.ts +3 -3
  15. package/dist/packem.mjs +72 -72
  16. package/dist/packem_shared/{Mime-BsyBfmma.cjs → Mime-B8VUfQZ4.cjs} +1 -1
  17. package/dist/packem_shared/{Mime-CNzz9C62.mjs → Mime-BhRZQHGy.mjs} +1 -1
  18. package/dist/packem_shared/{types-CaDbpbAk.d.mts → types-9j5aBtpH.d.mts} +3 -3
  19. package/dist/packem_shared/{types-lk8-9Jo6.d.ts → types-C2B7YY5i.d.ts} +3 -3
  20. package/dist/packem_shared/{types-BLR6WWv2.d.ts → types-Cxx27LIj.d.cts} +1 -1
  21. package/dist/packem_shared/{types-BLR6WWv2.d.cts → types-Cxx27LIj.d.mts} +1 -1
  22. package/dist/packem_shared/{types-BLR6WWv2.d.mts → types-Cxx27LIj.d.ts} +1 -1
  23. package/dist/packem_shared/{types-DYhavt9g.d.cts → types-DuwCnNZN.d.cts} +3 -3
  24. package/dist/packem_shared/{url-I6Jx3crl.mjs → url-DQUPWlUq.mjs} +1 -1
  25. package/dist/rollup/plugins/css/loaders/less/index.d.cts +2 -2
  26. package/dist/rollup/plugins/css/loaders/less/index.d.mts +2 -2
  27. package/dist/rollup/plugins/css/loaders/less/index.d.ts +2 -2
  28. package/dist/rollup/plugins/css/loaders/less/index.mjs +1 -1
  29. package/dist/rollup/plugins/css/loaders/lightningcss.d.cts +2 -2
  30. package/dist/rollup/plugins/css/loaders/lightningcss.d.mts +2 -2
  31. package/dist/rollup/plugins/css/loaders/lightningcss.d.ts +2 -2
  32. package/dist/rollup/plugins/css/loaders/postcss/index.cjs +1 -1
  33. package/dist/rollup/plugins/css/loaders/postcss/index.d.cts +2 -2
  34. package/dist/rollup/plugins/css/loaders/postcss/index.d.mts +2 -2
  35. package/dist/rollup/plugins/css/loaders/postcss/index.d.ts +2 -2
  36. package/dist/rollup/plugins/css/loaders/postcss/index.mjs +2 -2
  37. package/dist/rollup/plugins/css/loaders/sass/index.d.cts +2 -2
  38. package/dist/rollup/plugins/css/loaders/sass/index.d.mts +2 -2
  39. package/dist/rollup/plugins/css/loaders/sass/index.d.ts +2 -2
  40. package/dist/rollup/plugins/css/loaders/sass/index.mjs +1 -1
  41. package/dist/rollup/plugins/css/loaders/sourcemap.d.cts +2 -2
  42. package/dist/rollup/plugins/css/loaders/sourcemap.d.mts +2 -2
  43. package/dist/rollup/plugins/css/loaders/sourcemap.d.ts +2 -2
  44. package/dist/rollup/plugins/css/loaders/sourcemap.mjs +1 -1
  45. package/dist/rollup/plugins/css/loaders/stylus/index.d.cts +2 -2
  46. package/dist/rollup/plugins/css/loaders/stylus/index.d.mts +2 -2
  47. package/dist/rollup/plugins/css/loaders/stylus/index.d.ts +2 -2
  48. package/dist/rollup/plugins/css/minifiers/cssnano.d.cts +2 -2
  49. package/dist/rollup/plugins/css/minifiers/cssnano.d.mts +2 -2
  50. package/dist/rollup/plugins/css/minifiers/cssnano.d.ts +2 -2
  51. package/dist/rollup/plugins/css/minifiers/lightningcss.d.cts +2 -2
  52. package/dist/rollup/plugins/css/minifiers/lightningcss.d.mts +2 -2
  53. package/dist/rollup/plugins/css/minifiers/lightningcss.d.ts +2 -2
  54. package/dist/rollup/plugins/esbuild/index.d.cts +1 -1
  55. package/dist/rollup/plugins/esbuild/index.d.mts +1 -1
  56. package/dist/rollup/plugins/esbuild/index.d.ts +1 -1
  57. package/dist/rollup/plugins/esbuild/index.mjs +2 -2
  58. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.cts +2 -2
  59. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.mts +2 -2
  60. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +2 -2
  61. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.cts +2 -2
  62. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.mts +2 -2
  63. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +2 -2
  64. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.cts +2 -2
  65. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.mts +2 -2
  66. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +2 -2
  67. package/package.json +8 -8
package/dist/packem.mjs CHANGED
@@ -1,18 +1,18 @@
1
- var ji=Object.defineProperty;var f=(e,t)=>ji(e,"name",{value:t,configurable:!0});import nt from"node:module";import Me,{env as $i,versions as Ei}from"node:process";import{cyan as D,bold as L,gray as V,green as Si,yellow as Oi,grey as Di}from"@visulima/colorize";import{findCacheDirSync as Pi}from"@visulima/find-cache-dir";import{readFile as Ct,isAccessible as De,writeFile as Ni,readFileSync as Ve,writeFileSync as ne,readJsonSync as Ci,writeJsonSync as _i,ensureDir as at,walk as Mi,isAccessibleSync as G,collectSync as Ii,emptyDir as Ti,readJson as Ai,ensureDirSync as Fi}from"@visulima/fs";import{formatBytes as K,duration as st}from"@visulima/humanizer";import{normalize as q,join as k,relative as _,dirname as A,basename as Y,isAbsolute as He,resolve as $,parse as Ie,toNamespacedPath as we,extname as Ge}from"@visulima/path";import{readTsConfig as Ri,findTsConfig as zi}from"@visulima/tsconfig";import Ji from"browserslist";import{defu as Wi}from"defu";import{createHooks as Bi}from"hookable";import{createJiti as _t}from"jiti";import{rollup as Mt,watch as rt,VERSION as Li}from"rollup";import{exec as qi}from"tinyexec";import{stat as Xe,chmod as Ui,readFile as Ki,readdir as Vi,rm as Hi}from"node:fs/promises";import{createReadStream as Gi,createWriteStream as Xi,readdirSync as Yi,existsSync as It}from"node:fs";import Tt from"@rollup/plugin-alias";import Qi from"@rollup/plugin-commonjs";import Zi from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as At}from"@rollup/plugin-node-resolve";import Ft from"@rollup/plugin-replace";import{wasm as eo}from"@rollup/plugin-wasm";import{isRelative as Rt,resolveAlias as to}from"@visulima/path/utils";import io from"rollup-plugin-polyfill-node";import{visualizer as oo}from"rollup-plugin-visualizer";import{minVersion as zt,valid as no,coerce as ao}from"semver";import{E as Q,D as Ye,C as so,S as ro,R as Jt,a as ke,P as me,b as pt,c as se,A as re}from"./packem_shared/constants-DSQIKVQe.mjs";import je from"node:assert/strict";import{extractAssignedNames as po,createFilter as ee}from"@rollup/pluginutils";import Z from"magic-string";import lo from"glob-parent";import{glob as co,isDynamicPattern as lt,globSync as mo}from"tinyglobby";import{d as uo,g as fo}from"./packem_shared/index-CsX3kGje.mjs";import{SourceMapGenerator as go}from"source-map-js";import{m as We}from"./packem_shared/sourcemap-DDVjvayf.mjs";import{i as vo,a as ho,b as ct,c as dt,e as Te,d as yo,f as H,p as xo,g as bo}from"./packem_shared/Mime-CNzz9C62.mjs";import{n as Ae}from"./packem_shared/ensure-auto-modules-9cmxx7iZ.mjs";import{findStaticImports as Wt,fileURLToPath as wo,resolveModuleExportNames as ko,resolvePath as mt}from"mlly";import{parseAsync as jo}from"oxc-parser";import $o from"@rollup/plugin-json";import Eo from"rollup-plugin-license";import{g as So,d as Oo}from"./packem_shared/create-or-update-key-storage-BxGi6kMH.mjs";import"@visulima/fs/utils";import{fileURLToPath as Do}from"node:url";import{parse as Po}from"@babel/parser";import No from"node:crypto";import Co from"child_process";import{parsePackageJson as _o}from"@visulima/package/package-json";import{NotFoundError as Mo}from"@visulima/fs/error";import{distance as Io}from"fastest-levenshtein";import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
1
+ var jo=Object.defineProperty;var f=(e,t)=>jo(e,"name",{value:t,configurable:!0});import nt from"node:module";import Te,{env as $o,versions as Eo}from"node:process";import{cyan as D,green as So,bold as L,gray as H,yellow as Oo,grey as Do}from"@visulima/colorize";import{findCacheDirSync as Po}from"@visulima/find-cache-dir";import{readFile as Ct,isAccessible as De,writeFile as No,readFileSync as Ge,writeFileSync as ne,readJsonSync as Co,writeJsonSync as _o,ensureDir as at,walk as Mo,isAccessibleSync as U,collectSync as Io,emptyDir as To,readJson as Ao,ensureDirSync as Fo}from"@visulima/fs";import{formatBytes as V,duration as st}from"@visulima/humanizer";import{normalize as q,join as w,relative as _,dirname as A,basename as Y,isAbsolute as Xe,resolve as E,parse as Ae,toNamespacedPath as we,extname as Pe}from"@visulima/path";import{readTsConfig as Ro,findTsConfig as zo}from"@visulima/tsconfig";import Jo from"browserslist";import{defu as Wo}from"defu";import{createHooks as Bo}from"hookable";import{createJiti as _t}from"jiti";import{rollup as Mt,watch as rt,VERSION as Lo}from"rollup";import{exec as qo}from"tinyexec";import{stat as Ye,chmod as Uo,readFile as Ko,readdir as Vo,rm as Ho}from"node:fs/promises";import{createReadStream as Go,createWriteStream as Xo,readdirSync as Yo,existsSync as Qo}from"node:fs";import It from"@rollup/plugin-alias";import Zo from"@rollup/plugin-commonjs";import ei from"@rollup/plugin-dynamic-import-vars";import{nodeResolve as Tt}from"@rollup/plugin-node-resolve";import At from"@rollup/plugin-replace";import{wasm as ti}from"@rollup/plugin-wasm";import{isRelative as Ft,resolveAlias as oi}from"@visulima/path/utils";import ii from"rollup-plugin-polyfill-node";import{visualizer as ni}from"rollup-plugin-visualizer";import{minVersion as Rt,valid as ai,coerce as si}from"semver";import{E as Q,D as Ne,C as ri,S as pi,R as zt,a as ke,P as me,b as pt,c as se,A as re}from"./packem_shared/constants-DSQIKVQe.mjs";import je from"node:assert/strict";import{extractAssignedNames as li,createFilter as ee}from"@rollup/pluginutils";import Z from"magic-string";import ci from"glob-parent";import{glob as di,isDynamicPattern as lt,globSync as mi}from"tinyglobby";import{d as ui,g as fi}from"./packem_shared/index-CsX3kGje.mjs";import{SourceMapGenerator as gi}from"source-map-js";import{m as Le}from"./packem_shared/sourcemap-DDVjvayf.mjs";import{i as vi,a as hi,b as ct,c as dt,e as Fe,d as yi,f as G,p as xi,g as bi}from"./packem_shared/Mime-BhRZQHGy.mjs";import{n as Re}from"./packem_shared/ensure-auto-modules-9cmxx7iZ.mjs";import{findStaticImports as Jt,fileURLToPath as wi,resolveModuleExportNames as ki,resolvePath as mt}from"mlly";import{parseAsync as ji}from"oxc-parser";import $i from"@rollup/plugin-json";import Ei from"rollup-plugin-license";import{g as Si,d as Oi}from"./packem_shared/create-or-update-key-storage-BxGi6kMH.mjs";import{fileURLToPath as Di}from"node:url";import{parse as Pi}from"@babel/parser";import Ni from"node:crypto";import Ci from"child_process";import{parsePackageJson as _i}from"@visulima/package/package-json";import{NotFoundError as Mi}from"@visulima/fs/error";import{distance as Ii}from"fastest-levenshtein";import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
2
2
  import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
3
3
  import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
4
4
  const __filename = __cjs_url__.fileURLToPath(import.meta.url);
5
5
  const __dirname = __cjs_path__.dirname(__filename);
6
6
  const require = __cjs_mod__.createRequire(import.meta.url);
7
- var To=Object.defineProperty,Ao=f((e,t)=>To(e,"name",{value:t,configurable:!0}),"a$m");const Be=Ao((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var Fo=Object.defineProperty,Ro=f((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"a$l");const ue=Ro(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var zo=Object.defineProperty,Jo=f((e,t)=>zo(e,"name",{value:t,configurable:!0}),"a$k");const Bt=Jo((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var Wo=Object.defineProperty,Lt=f((e,t)=>Wo(e,"name",{value:t,configurable:!0}),"s$e");const Bo=Lt((e,t,i)=>{const o=i??new Map;return(...n)=>{const a=t?typeof t=="function"?t(...n):t:JSON.stringify({args:n}),s=o.get(a);if(s!==void 0)return s;const p=e(...n);return o.set(a,p),p}},"memoize"),Lo=Lt(e=>{const t=new Map;return i=>Bo(e,i,t)},"memoizeByKey");var qo=Object.defineProperty,fe=f((e,t)=>qo(e,"name",{value:t,configurable:!0}),"r$e");const Uo=fe(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;je(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 po(t.id))yield i;break}}},"exportName"),Ko=fe(function*(e){if(e.declaration)for(const t of Uo(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"),Vo=fe(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Ho=fe(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),Go=fe(function*(e,t){je(t.code!=null,`Module ${t.id} doesn't have associated code`);const i=e.parse(t.code);for(const o of i.body)switch(o.type){case"ExportAllDeclaration":{yield*Vo(o);break}case"ExportDefaultDeclaration":{yield*Ho();break}case"ExportNamedDeclaration":{yield*Ko(o);break}}},"parseExports");var Xo=Object.defineProperty,ge=f((e,t)=>Xo(e,"name",{value:t,configurable:!0}),"n$c");const qt=ge(async function(e,t,i){const o=await e.resolve(t,i.id);if(je(o,`Rollup can't resolve ${t} from ${i.id}`),o.external)return null;const n=await e.load(o);return je(n,`Rollup doesn't have a module for id ${o.id}`),n},"getImportedModule"),Yo=ge(async function*(e,t,i){const o=await qt(e,t.source,i);o&&(yield*Qe(e,o))},"gatherBarrelReExports"),Qo=ge(async function*(e,t,i){const o=await qt(e,t.source,i);if(!o)return;const n=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of Qe(e,o)){const s=n.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),Zo=ge(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),Qe=ge(async function*(e,t){for(const i of Go(e,t))i.from==="self"?yield*Zo(t,i):i.type==="barrel"?yield*Yo(e,i,t):yield*Qo(e,i,t)},"gatherExports");var en=Object.defineProperty,tn=f((e,t)=>en(e,"name",{value:t,configurable:!0}),"r$d");const on=tn(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of Qe(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 nn=Object.defineProperty,an=f((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r$c");const sn=an((e,t)=>{const i=e,o=[];let n;for(;(n=i.exec(t))!==null;)n.index===i.lastIndex&&i.lastIndex++,n.forEach(a=>{o.push(a)});return o.filter(Boolean)},"getRegexMatches");var rn=Object.defineProperty,pn=f((e,t)=>rn(e,"name",{value:t,configurable:!0}),"a$j");const Ut=pn(e=>{const t=sn(/export\s(\{\s(.*)\s\}|default\s.*);/g,e);if(t.length===0)return null;const i=t.at(-1).split(", ");let o="";for(const n of i)if(!n.includes("type")&&(n.includes("default ")&&(o=n.split("default ")[1]),n.includes("as"))){const[a,s]=n.split(" as ");s==="default"&&(o=a)}if(o!==""){const n=new Z(e);return n.replace(new RegExp(`(,s)?${o} as default(,)?`),""),n.replace(new RegExp(`export default ${o};
7
+ var Ti=Object.defineProperty,Ai=f((e,t)=>Ti(e,"name",{value:t,configurable:!0}),"a$m");const qe=Ai((e,t)=>e.some(o=>o instanceof RegExp?o.test(t):o===t),"arrayIncludes");var Fi=Object.defineProperty,Ri=f((e,t)=>Fi(e,"name",{value:t,configurable:!0}),"a$l");const ue=Ri(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var zi=Object.defineProperty,Ji=f((e,t)=>zi(e,"name",{value:t,configurable:!0}),"a$k");const Wt=Ji((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var Wi=Object.defineProperty,Bt=f((e,t)=>Wi(e,"name",{value:t,configurable:!0}),"s$e");const Bi=Bt((e,t,o)=>{const i=o??new Map;return(...n)=>{const a=t?typeof t=="function"?t(...n):t:JSON.stringify({args:n}),s=i.get(a);if(s!==void 0)return s;const p=e(...n);return i.set(a,p),p}},"memoize"),Li=Bt(e=>{const t=new Map;return o=>Bi(e,o,t)},"memoizeByKey");var qi=Object.defineProperty,fe=f((e,t)=>qi(e,"name",{value:t,configurable:!0}),"r$d");const Ui=fe(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;je(t,"Expected class/function to have a name"),yield t.name;break}case"VariableDeclaration":{for(const t of e.declaration.declarations)for(const o of li(t.id))yield o;break}}},"exportName"),Ki=fe(function*(e){if(e.declaration)for(const t of Ui(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"),Vi=fe(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Hi=fe(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),Gi=fe(function*(e,t){je(t.code!=null,`Module ${t.id} doesn't have associated code`);const o=e.parse(t.code);for(const i of o.body)switch(i.type){case"ExportAllDeclaration":{yield*Vi(i);break}case"ExportDefaultDeclaration":{yield*Hi();break}case"ExportNamedDeclaration":{yield*Ki(i);break}}},"parseExports");var Xi=Object.defineProperty,ge=f((e,t)=>Xi(e,"name",{value:t,configurable:!0}),"n$c");const Lt=ge(async function(e,t,o){const i=await e.resolve(t,o.id);if(je(i,`Rollup can't resolve ${t} from ${o.id}`),i.external)return null;const n=await e.load(i);return je(n,`Rollup doesn't have a module for id ${i.id}`),n},"getImportedModule"),Yi=ge(async function*(e,t,o){const i=await Lt(e,t.source,o);i&&(yield*Qe(e,i))},"gatherBarrelReExports"),Qi=ge(async function*(e,t,o){const i=await Lt(e,t.source,o);if(!i)return;const n=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of Qe(e,i)){const s=n.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),Zi=ge(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),Qe=ge(async function*(e,t){for(const o of Gi(e,t))o.from==="self"?yield*Zi(t,o):o.type==="barrel"?yield*Yi(e,o,t):yield*Qi(e,o,t)},"gatherExports");var en=Object.defineProperty,tn=f((e,t)=>en(e,"name",{value:t,configurable:!0}),"r$c");const on=tn(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of Qe(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 nn=Object.defineProperty,an=f((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r$b");const sn=an((e,t)=>{const o=e,i=[];let n;for(;(n=o.exec(t))!==null;)n.index===o.lastIndex&&o.lastIndex++,n.forEach(a=>{i.push(a)});return i.filter(Boolean)},"getRegexMatches");var rn=Object.defineProperty,pn=f((e,t)=>rn(e,"name",{value:t,configurable:!0}),"a$j");const qt=pn(e=>{const t=sn(/export\s(\{\s(.*)\s\}|default\s.*);/g,e);if(t.length===0)return null;const o=t.at(-1).split(", ");let i="";for(const n of o)if(!n.includes("type")&&(n.includes("default ")&&(i=n.split("default ")[1]),n.includes("as"))){const[a,s]=n.split(" as ");s==="default"&&(i=a)}if(i!==""){const n=new Z(e);return n.replace(new RegExp(`(,s)?${i} as default(,)?`),""),n.replace(new RegExp(`export default ${i};
8
8
  ?`),""),n.append(`
9
9
 
10
- export = `+o+";"),{code:n.toString().replace(/export\s\{\s\s\};/,""),map:n.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var ln=Object.defineProperty,ut=f((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i$9");const Kt=ut(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:ut(async(o,n,a)=>{if(n.type!=="chunk"||!n.isEntry)return null;if(a.format==="cjs"&&a.exports==="auto"){const s=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(o);if(s===null||s.length<3)return null;const p=new Z(o);p.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),p.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&p.append(`
11
- module.exports.default = `+s[2]+";");let l=p.toString();return l=l.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:l,map:p.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?i!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:Ut(o):null},"renderChunk")}),"cjsInteropPlugin");var cn=Object.defineProperty,dn=f((e,t)=>cn(e,"name",{value:t,configurable:!0}),"f$e");const mn=dn((e,t)=>{const i=new Map,o={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:n}=o;return Array.isArray(n)?n=n.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof n=="string"&&(n=[{src:n}]),{async buildStart(){const a=await Promise.all(n.flatMap(s=>Array.isArray(s.src)?s.src.map(p=>({...s,src:p})):s).map(async s=>await co(ue(s.src),{ignore:ue(s.exclude).filter(Boolean)}).then(p=>({dest:s.dest??"",parent:lo(s.src),src:p}))));for(const s of a)for(const p of s.src){let l;i.has(p)?l=i.get(p):(l={copied:[],dest:[],timestamp:0},i.set(p,l));const r=o.flatten?q(s.dest):k(s.dest,_(s.parent,A(p)));l.dest.includes(r)||l.dest.push(r),this.addWatchFile(p)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,p])=>{let l;try{const r=await Xe(s);if(!r.isFile())return;const c=r.mtime.getTime();c>p.timestamp&&(p.timestamp=c,p.copied=[]),l=await Ct(s,{buffer:!0})}catch(r){t.error({context:[r],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const r of p.dest){if(o.copyOnce&&p.copied.includes(r))continue;const c=Y(s),m=k(r,c);try{this.emitFile({[o.exactFileNames?"fileName":"name"]:m,source:l,type:"asset"}),t.debug({message:`copied ${s} → ${m}`,prefix:"plugin:copy"}),p.copied.push(r)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${m}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");var un=Object.defineProperty,fn=f((e,t)=>un(e,"name",{value:t,configurable:!0}),"r$b");const ft=fn((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 gn=Object.defineProperty,vn=f((e,t)=>gn(e,"name",{value:t,configurable:!0}),"a$i");const hn=4,yn=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):hn;let xn=class{static{f(this,"f")}static{vn(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:i,logger:o,options:n}){this.test=a=>t.some(s=>a.toLowerCase().endsWith(s)),i.length>0&&this.add(...i),this.options=n,this.logger=o}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(ft(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new uo({concurrency:yn-1}));for await(const[o,n]of this.loaders){const a={...i,options:this.options[o]??{}};if(n.alwaysProcess||ft(a.id,n.test)){this.logger.debug(`Processing ${o} loader for ${a.id}`);const s=await this.workQueue.add(n.process.bind(a,t));s&&(t=s)}}return t}};var bn=Object.defineProperty,wn=f((e,t)=>bn(e,"name",{value:t,configurable:!0}),"u$a");const kn=wn(async e=>{const t=new go({file:""}),i=[];let o=0;for await(const{css:n,map:a}of e){i.push(n);const s=We(a),p=s.toObject();if(!p)continue;const l=s.toConsumer();if(l){if(l.eachMapping(r=>{t.addMapping({generated:{column:r.generatedColumn,line:o+r.generatedLine},name:r.name,original:{column:r.originalColumn,line:r.originalLine},source:r.source})}),p.sourcesContent)for(const r of p.sources)t.setSourceContent(r,l.sourceContentFor(r,!0));o+=n.split(`
12
- `).length}}return{css:i.join(`
13
- `),map:t}},"concat");var jn=Object.defineProperty,le=f((e,t)=>jn(e,"name",{value:t,configurable:!0}),"b$3");const $n=le(async(e,t)=>e.sort((i,o)=>t.indexOf(i.name)-t.indexOf(o.name)),"sortByNameOrder"),En=le(async(e,t,i,o,n,a,s,p,l,r)=>{const c={...r,...e.alias},m=ee(e.include,e.exclude),d=vo(e.sourceMap),u={...ho(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof u.inject=="object"&&u.inject.treeshakeable&&(u.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let v=!1;if(e.loaders)for(const b of e.loaders)b.name==="postcss"&&(v=!0);else e.loaders=[];v&&(u.postcss={...e.postcss,config:ct(e.postcss?.config,{}),import:dt(e.postcss?.import,c),modules:ct(e.postcss?.modules,void 0),to:e.postcss?.to,url:dt(e.postcss?.url,c)},e.postcss?.parser&&(u.postcss.parser=await Te(e.postcss.parser,"parser",o)),e.postcss?.syntax&&(u.postcss.syntax=await Te(e.postcss.syntax,"syntax",o)),e.postcss?.stringifier&&(u.postcss.stringifier=await Te(e.postcss.stringifier,"stringifier",o)),e.postcss?.plugins&&(u.postcss.plugins=await yo(e.postcss.plugins,o)));const x=new xn({extensions:u.extensions,loaders:await $n(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...u,alias:c}});let y=[];const g=le((b,w)=>{const O=[];for(const h of Object.keys(b)){const N=new Set;let M=[h];do{const J=[];for(const F of M){if(N.has(F))continue;if(x.isSupported(F)){m(F)&&J.push(F);continue}N.add(F);const ie=w(F);ie&&J.push(...ie.importedIds)}M=J}while(M.some(J=>!x.isSupported(J)));O.push(...M)}return O},"traverseImportedModules");return{augmentChunkHash(b){if(y.length===0)return null;const w=g(b.modules,this.getModuleInfo),O=y.filter(h=>w.includes(h.id)).sort((h,N)=>w.lastIndexOf(h.id)-w.lastIndexOf(N.id)).map(h=>`${Y(h.id)}:${h.css}`);return O.length===0?null:O.join(":")},async generateBundle(b,w){if(y.length===0||!(b.dir||b.file))return;const O=Object.values(w),h=b.dir??A(b.file),N=O.filter(E=>E.type==="chunk"),M=N.filter(E=>!E.facadeModuleId),J=b.preserveModules?N:N.filter(E=>E.isEntry||E.isDynamicEntry),F=[],ie=le(async(E,P)=>{const j=typeof u.extract=="string"?q(u.extract).replace(/^\.[/\\]/,""):q(`${E}.css`);He(j)&&this.error(["Extraction path must be relative to the output directory,",`which is ${_(o,h)}`].join(`
14
- `)),Rt(j)&&this.error(["Extraction path must be nested inside output directory,",`which is ${_(o,h)}`].join(`
15
- `));const W=y.filter(B=>P.includes(B.id)).sort((B,oe)=>P.lastIndexOf(B.id)-P.lastIndexOf(oe.id)),ve=await kn(W);return{css:ve.css,map:We(ve.map.toString()).relative(A($(h,j))).toString(),name:j}},"getExtractedData"),R=le(E=>{if(b.file)return Ie(b.file).name;if(b.preserveModules){const{dir:P,name:j}=Ie(E.fileName);return P?k(P,j):j}return E.name},"getName"),U=[];if(typeof u.extract=="string"){t.debug({message:`Extracting to ${u.extract}`,prefix:"css"});const E=[];for(const j of M){const W=g(j.modules,this.getModuleInfo);U.push(...W),E.push(...W)}for(const j of J)E.push(...g(j.modules,this.getModuleInfo).filter(W=>!U.includes(W)));const P=R(N[0]);F.push([P,E])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const E of M){const P=g(E.modules,this.getModuleInfo);if(P.length===0)continue;U.push(...P);const j=R(E);F.push([j,P])}for(const E of J){const P=g(E.modules,this.getModuleInfo).filter(W=>!U.includes(W));if(P.length===0)continue;const j=R(E);F.push([j,P])}}for await(const[E,P]of F){const j=await ie(E,P);if(typeof e.onExtract=="function"&&!e.onExtract(j))continue;if(l&&e.minifier){t.info({message:`Minifying ${j.name} with ${e.minifier.name}`,prefix:"css"});const{css:B,map:oe}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})(j,d,e[e.minifier.name]??{});j.css=B,j.map=oe}const W={fileName:j.name,name:j.name,names:[j.name],originalFileName:j.name,originalFileNames:[j.name],source:j.css,type:"asset"},ve=this.emitFile(W);if(j.map&&d){const B=this.getFileName(ve),oe=typeof b.assetFileNames=="string"?q(A(b.assetFileNames)):typeof b.assetFileNames=="function"?q(A(b.assetFileNames(W))):"assets",ae=We(j.map).modify(C=>(C.file=Y(B),C)).modifySources(C=>{if(C==="<no source>"||oe.length<=1)return C;C=`../${C}`;for(const _e of oe)_e==="/"&&(C=`../${C}`);return C});if(d.inline)ae.modify(C=>d.transform?.(C,q(k(h,B)))),w[B].source+=ae.toCommentData();else{const C=`${B}.map`;ae.modify(ki=>d.transform?.(ki,q(k(h,C)))),this.emitFile({fileName:C,source:ae.toString(),type:"asset"});const{base:_e}=Ie(C);w[B].source+=ae.toCommentFile(_e)}}}},name:"packem:css",async transform(b,w){if(!m(w)||!x.isSupported(w)||b.replaceAll(/\s/g,"")==="")return null;try{return this.parse(b,{}),this.warn(`Skipping processed file ${_(o,w)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(b,w);const O={alias:c,assets:new Map,autoModules:u.autoModules,browserTargets:i,cwd:o,debug:p,deps:new Set,dts:u.dts,emit:u.emit,environment:a,extensions:u.extensions,extract:u.extract,id:w,inject:u.inject,logger:t,namedExports:u.namedExports,options:{},plugin:this,sourceDir:n,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},h=await x.process({code:b},O);for(const N of O.deps)this.addWatchFile(N);for(const[N,M]of O.assets)this.emitFile({fileName:N,source:M,type:"asset"});if(h.extracted){const{id:N}=h.extracted;y=y.filter(M=>M.id!==N),y.push(h.extracted)}return{code:h.code,map:d&&h.map?h.map:{mappings:""},meta:{styles:h.meta},moduleSideEffects:h.extracted?!0:null}}}},"default");var Sn=Object.defineProperty,On=f((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"u$9");const Dn=`
10
+ export = `+i+";"),{code:n.toString().replace(/export\s\{\s\s\};/,""),map:n.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var ln=Object.defineProperty,ut=f((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i$9");const Ut=ut(({addDefaultProperty:e=!1,logger:t,type:o})=>({name:"packem:cjs-interop",renderChunk:ut(async(i,n,a)=>{if(n.type!=="chunk"||!n.isEntry)return null;if(a.format==="cjs"&&a.exports==="auto"){const s=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(i);if(s===null||s.length<3)return null;const p=new Z(i);p.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),p.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&p.append(`
11
+ module.exports.default = `+s[2]+";");let l=p.toString();return l=l.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:l,map:p.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?o!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:qt(i):null},"renderChunk")}),"cjsInteropPlugin");var cn=Object.defineProperty,dn=f((e,t)=>cn(e,"name",{value:t,configurable:!0}),"f$e");const mn=dn((e,t)=>{const o=new Map,i={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:n}=i;return Array.isArray(n)?n=n.map(a=>{if(typeof a=="string")return{src:a};if(typeof a=="object"&&"src"in a)return a}).filter(Boolean):typeof n=="string"&&(n=[{src:n}]),{async buildStart(){const a=await Promise.all(n.flatMap(s=>Array.isArray(s.src)?s.src.map(p=>({...s,src:p})):s).map(async s=>await di(ue(s.src),{ignore:ue(s.exclude).filter(Boolean)}).then(p=>({dest:s.dest??"",parent:ci(s.src),src:p}))));for(const s of a)for(const p of s.src){let l;o.has(p)?l=o.get(p):(l={copied:[],dest:[],timestamp:0},o.set(p,l));const r=i.flatten?q(s.dest):w(s.dest,_(s.parent,A(p)));l.dest.includes(r)||l.dest.push(r),this.addWatchFile(p)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...o].map(async([s,p])=>{let l;try{const r=await Ye(s);if(!r.isFile())return;const c=r.mtime.getTime();c>p.timestamp&&(p.timestamp=c,p.copied=[]),l=await Ct(s,{buffer:!0})}catch(r){t.error({context:[r],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const r of p.dest){if(i.copyOnce&&p.copied.includes(r))continue;const c=Y(s),m=w(r,c);try{this.emitFile({[i.exactFileNames?"fileName":"name"]:m,source:l,type:"asset"}),t.debug({message:`copied ${s} → ${m}`,prefix:"plugin:copy"}),p.copied.push(r)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${m}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");var un=Object.defineProperty,fn=f((e,t)=>un(e,"name",{value:t,configurable:!0}),"r$a");const ft=fn((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 gn=Object.defineProperty,vn=f((e,t)=>gn(e,"name",{value:t,configurable:!0}),"a$i");const hn=4,yn=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):hn;let xn=class{static{f(this,"f")}static{vn(this,"LoaderManager")}test;loaders=new Map;options;workQueue;logger;constructor({extensions:t,loaders:o,logger:i,options:n}){this.test=a=>t.some(s=>a.toLowerCase().endsWith(s)),o.length>0&&this.add(...o),this.options=n,this.logger=i}add(...t){for(const o of t)this.loaders.has(o.name)||this.loaders.set(o.name,o)}isSupported(t){if(this.test(t))return!0;for(const[,o]of this.loaders)if(ft(t,o.test))return!0;return!1}async process(t,o){this.workQueue||(this.workQueue=new ui({concurrency:yn-1}));for await(const[i,n]of this.loaders){const a={...o,options:this.options[i]??{}};if(n.alwaysProcess||ft(a.id,n.test)){this.logger.debug(`Processing ${i} loader for ${a.id}`);const s=await this.workQueue.add(n.process.bind(a,t));s&&(t=s)}}return t}};var bn=Object.defineProperty,wn=f((e,t)=>bn(e,"name",{value:t,configurable:!0}),"u$b");const kn=wn(async e=>{const t=new gi({file:""}),o=[];let i=0;for await(const{css:n,map:a}of e){o.push(n);const s=Le(a),p=s.toObject();if(!p)continue;const l=s.toConsumer();if(l){if(l.eachMapping(r=>{t.addMapping({generated:{column:r.generatedColumn,line:i+r.generatedLine},name:r.name,original:{column:r.originalColumn,line:r.originalLine},source:r.source})}),p.sourcesContent)for(const r of p.sources)t.setSourceContent(r,l.sourceContentFor(r,!0));i+=n.split(`
12
+ `).length}}return{css:o.join(`
13
+ `),map:t}},"concat");var jn=Object.defineProperty,le=f((e,t)=>jn(e,"name",{value:t,configurable:!0}),"b$3");const $n=le(async(e,t)=>e.sort((o,i)=>t.indexOf(o.name)-t.indexOf(i.name)),"sortByNameOrder"),En=le(async(e,t,o,i,n,a,s,p,l,r)=>{const c={...r,...e.alias},m=ee(e.include,e.exclude),d=vi(e.sourceMap),u={...hi(e.mode),autoModules:e.autoModules??!1,dts:e.dts,extensions:e.extensions,namedExports:e.namedExports};typeof u.inject=="object"&&u.inject.treeshakeable&&(u.namedExports=!1,t.info({message:"Disabling named exports due to `inject.treeshakeable` option",prefix:"css"}));let h=!1;if(e.loaders)for(const x of e.loaders)x.name==="postcss"&&(h=!0);else e.loaders=[];h&&(u.postcss={...e.postcss,config:dt(e.postcss?.config,{}),import:ct(e.postcss?.import,c),modules:dt(e.postcss?.modules,void 0),to:e.postcss?.to,url:ct(e.postcss?.url,c)},e.postcss?.parser&&(u.postcss.parser=await Fe(e.postcss.parser,"parser",i)),e.postcss?.syntax&&(u.postcss.syntax=await Fe(e.postcss.syntax,"syntax",i)),e.postcss?.stringifier&&(u.postcss.stringifier=await Fe(e.postcss.stringifier,"stringifier",i)),e.postcss?.plugins&&(u.postcss.plugins=await yi(e.postcss.plugins,i)));const v=new xn({extensions:u.extensions,loaders:await $n(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...u,alias:c}});let b=[];const g=le((x,k)=>{const $=[];for(const y of Object.keys(x)){const N=new Set;let M=[y];do{const J=[];for(const F of M){if(N.has(F))continue;if(v.isSupported(F)){m(F)&&J.push(F);continue}N.add(F);const oe=k(F);oe&&J.push(...oe.importedIds)}M=J}while(M.some(J=>!v.isSupported(J)));$.push(...M)}return $},"traverseImportedModules");return{augmentChunkHash(x){if(b.length===0)return null;const k=g(x.modules,this.getModuleInfo),$=b.filter(y=>k.includes(y.id)).sort((y,N)=>k.lastIndexOf(y.id)-k.lastIndexOf(N.id)).map(y=>`${Y(y.id)}:${y.css}`);return $.length===0?null:$.join(":")},async generateBundle(x,k){if(b.length===0||!(x.dir||x.file))return;const $=Object.values(k),y=x.dir??A(x.file),N=$.filter(S=>S.type==="chunk"),M=N.filter(S=>!S.facadeModuleId),J=x.preserveModules?N:N.filter(S=>S.isEntry||S.isDynamicEntry),F=[],oe=le(async(S,P)=>{const j=typeof u.extract=="string"?q(u.extract).replace(/^\.[/\\]/,""):q(`${S}.css`);Xe(j)&&this.error(["Extraction path must be relative to the output directory,",`which is ${_(i,y)}`].join(`
14
+ `)),Ft(j)&&this.error(["Extraction path must be nested inside output directory,",`which is ${_(i,y)}`].join(`
15
+ `));const W=b.filter(B=>P.includes(B.id)).sort((B,ie)=>P.lastIndexOf(B.id)-P.lastIndexOf(ie.id)),ve=await kn(W);return{css:ve.css,map:Le(ve.map.toString()).relative(A(E(y,j))).toString(),name:j}},"getExtractedData"),R=le(S=>{if(x.file)return Ae(x.file).name;if(x.preserveModules){const{dir:P,name:j}=Ae(S.fileName);return P?w(P,j):j}return S.name},"getName"),K=[];if(typeof u.extract=="string"){t.debug({message:`Extracting to ${u.extract}`,prefix:"css"});const S=[];for(const j of M){const W=g(j.modules,this.getModuleInfo);K.push(...W),S.push(...W)}for(const j of J)S.push(...g(j.modules,this.getModuleInfo).filter(W=>!K.includes(W)));const P=R(N[0]);F.push([P,S])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const S of M){const P=g(S.modules,this.getModuleInfo);if(P.length===0)continue;K.push(...P);const j=R(S);F.push([j,P])}for(const S of J){const P=g(S.modules,this.getModuleInfo).filter(W=>!K.includes(W));if(P.length===0)continue;const j=R(S);F.push([j,P])}}for await(const[S,P]of F){const j=await oe(S,P);if(typeof e.onExtract=="function"&&!e.onExtract(j))continue;if(l&&e.minifier){t.info({message:`Minifying ${j.name} with ${e.minifier.name}`,prefix:"css"});const{css:B,map:ie}=await e.minifier.handler.bind({browserTargets:o,warn:this.warn.bind(this)})(j,d,e[e.minifier.name]??{});j.css=B,j.map=ie}const W={fileName:j.name,name:j.name,names:[j.name],originalFileName:j.name,originalFileNames:[j.name],source:j.css,type:"asset"},ve=this.emitFile(W);if(j.map&&d){const B=this.getFileName(ve),ie=typeof x.assetFileNames=="string"?q(A(x.assetFileNames)):typeof x.assetFileNames=="function"?q(A(x.assetFileNames(W))):"assets",ae=Le(j.map).modify(C=>(C.file=Y(B),C)).modifySources(C=>{if(C==="<no source>"||ie.length<=1)return C;C=`../${C}`;for(const Ie of ie)Ie==="/"&&(C=`../${C}`);return C});if(d.inline)ae.modify(C=>d.transform?.(C,q(w(y,B)))),k[B].source+=ae.toCommentData();else{const C=`${B}.map`;ae.modify(ko=>d.transform?.(ko,q(w(y,C)))),this.emitFile({fileName:C,source:ae.toString(),type:"asset"});const{base:Ie}=Ae(C);k[B].source+=ae.toCommentFile(Ie)}}}},name:"packem:css",async transform(x,k){if(!m(k)||!v.isSupported(k)||x.replaceAll(/\s/g,"")==="")return null;try{return this.parse(x,{}),this.warn(`Skipping processed file ${_(i,k)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(x,k);const $={alias:c,assets:new Map,autoModules:u.autoModules,browserTargets:o,cwd:i,debug:p,deps:new Set,dts:u.dts,emit:u.emit,environment:a,extensions:u.extensions,extract:u.extract,id:k,inject:u.inject,logger:t,namedExports:u.namedExports,options:{},plugin:this,sourceDir:n,sourceMap:d,useSourcemap:s,warn:this.warn.bind(this)},y=await v.process({code:x},$);for(const N of $.deps)this.addWatchFile(N);for(const[N,M]of $.assets)this.emitFile({fileName:N,source:M,type:"asset"});if(y.extracted){const{id:N}=y.extracted;b=b.filter(M=>M.id!==N),b.push(y.extracted)}return{code:y.code,map:d&&y.map?y.map:{mappings:""},meta:{styles:y.meta},moduleSideEffects:y.extracted?!0:null}}}},"default");var Sn=Object.defineProperty,On=f((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"u$a");const Dn=`
16
16
  /* eslint-disable */
17
17
  /* prettier-ignore */
18
18
  // @ts-nocheck
@@ -20,88 +20,88 @@ module.exports.default = `+s[2]+";");let l=p.toString();return l=l.replace(/(?:m
20
20
  * Generated by packem
21
21
  * @see https://npmjs.com/@visulima/packem
22
22
  */
23
- `.trim(),Pn=On((e,t,i)=>{let o;return e.postcss&&typeof e.postcss.modules=="boolean"?o=e.postcss.modules:e.lightningcss&&typeof e.lightningcss.modules=="boolean"&&(o=e.lightningcss.modules),{async transform(n,a){let s=o;if(e.postcss&&typeof e.postcss.modules=="object"?s=Ae(e.postcss.modules.include,a):e.lightningcss&&typeof e.lightningcss.modules=="object"&&(s=Ae(e.lightningcss.modules.include,a)),e.autoModules&&s===void 0&&(s=Ae(e.autoModules,a)),!s)return null;const{types:p}=this.getModuleInfo(a)?.meta.styles??{};return p===void 0||await De(a)&&(await Ni(a+".d.ts",`${Dn}
24
- ${p}`),i.info({message:`Generated types for ${q(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var Nn=Object.defineProperty,Pe=f((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"t$9");const Cn=/\Wrequire(?:\.resolve)?\(/,_n=Pe((e,t)=>{if($i.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,o=!1,n=!1;if(e.includes("__filename")&&(i=!0),e.includes("__dirname")&&(o=!0),Cn.test(e)&&(n=!0),!i&&!o&&!n)return null;const a=Wt(e).pop(),s=a?a.end:0,p=new Z(e);return p.appendRight(s,t(i,o,n)),{code:p.toString(),map:p.generateMap()}},"CJSToESM"),Mn=Pe((e,t,i)=>{let o="";return(e||t)&&(o+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
25
- `),t&&(o+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
26
- `),i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
27
- `),(e||t)&&(o+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
28
- `),t&&(o+=`const __dirname = __cjs_path__.dirname(__filename);
29
- `),i&&(o+=`const require = __cjs_mod__.createRequire(import.meta.url);
30
- `),o},"generateCJSShim"),In=Pe((e,t,i)=>{let o="";return i&&(o+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
31
- `),e&&(o+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
32
- `),t&&(o+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
33
- `),i&&(o+=`const require = __cjs_mod__.createRequire(import.meta.url);
34
- `),o},"generateCJSShimNode20_11"),Tn=Pe((e,t)=>{const i=ee(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(o,n,a){if(a.format==="es"&&i(n.fileName)){let s=Mn;if(e.engines?.node){const p=zt(e.engines.node);p&&p.major>=20&&p.minor>=11&&(s=In)}return _n(o,s)}return null}}},"esmShimCjsSyntaxPlugin");var An=Object.defineProperty,Fn=f((e,t)=>An(e,"name",{value:t,configurable:!0}),"m$a");const Rn=Fn(()=>({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 zn=Object.defineProperty,Jn=f((e,t)=>zn(e,"name",{value:t,configurable:!0}),"a$h");const Wn=Jn((e,t)=>{const i=e.replace(/^\.\//,""),o=t.replace(/^\.\//,"");if(o.startsWith(i))return e+o.slice(i.length);if(e.endsWith(t))return e;const n=e.split("/"),a=t.split("/");let s=n.length-1,p=a.length-1;for(;s>=0&&p>=0&&n[s]===a[p];)s--,p--;const l=n.slice(0,s).join("/"),r=a.slice(p).join("/");return l+(r?"/"+r:"")},"extendString");var Bn=Object.defineProperty,Ln=f((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"s$b");const qn=Ln((...e)=>{if(e.length===0)return"";if(e.length===1)return A(e[0]);e=e.map(n=>we(n));const[t,...i]=e;let o=t.split("/");for(const n of i){const a=n.split("/",o.length);let s=0;for(const p of a)if(p===o[s])s+=1;else{o=o.slice(0,s);break}o=o.slice(0,s)}return o.length<=1&&o[0]===""?`/${o[0]}`:o.join("/")},"lowestCommonAncestor");var Un=Object.defineProperty,Fe=f((e,t)=>Un(e,"name",{value:t,configurable:!0}),"m$8");const Kn=Fe((e,t,i,o,n={})=>{const a=ee(n.include,n.exclude),s={},p=Fe((r,c)=>{s[r.replace(Q,"")]=c},"addOutput");async function l(r,c){if(!a(c))return;let m;try{const x=await jo(r,{sourceFilename:c});m=JSON.parse(x.program)}catch{}if(m){const x=m.body.filter(y=>y.type==="ImportDeclaration"||y.type==="ExportAllDeclaration"||y.type==="ExportNamedDeclaration");for(const y of x){if(!y.source||Y(y.source.value).includes("."))continue;const g=await this.resolve(y.source.value,c);if(!(!g||g.external)&&(g.id.endsWith(".ts")||g.id.endsWith(".cts")||g.id.endsWith(".mts")||g.id.endsWith(".tsx")||g.id.endsWith(".ctsx")||g.id.endsWith(".mtsx"))){const b=g.id.replace(e+"/","");r=r.replaceAll('from "'+y.source.value+'"','from "'+Wn(y.source.value,b)+'"')}}}const{errors:d,sourceText:u}=await t(c,r);if(d.length>0){if(n.ignoreErrors){this.warn(d[0]);return}return this.error(d[0])}if(p(c,u),!m)return;const v=m.body.filter(x=>x.type==="ImportDeclaration"?x.importKind==="type"?!0:x.specifiers?.every(y=>y.type==="ImportSpecifier"&&y.importKind==="type"):x.type==="ExportNamedDeclaration"||x.type==="ExportAllDeclaration"?x.exportKind==="type"?!0:x.type==="ExportNamedDeclaration"&&x.specifiers?.every(y=>y.type==="ExportSpecifier"&&y.exportKind==="type"):!1);for await(const x of v){if(!x.source)continue;const y=await this.resolve(x.source.value,c);if(!y)return;const g=y.id;if(a(g)&&!s[g.replace(Q,"")])try{const b=await Ct(g);await l.call(this,b,g)}catch{}}}return f(l,"h"),Fe(l,"transform"),{name:"packem:isolated-declarations",async renderStart(r,{input:c}){const m=qn(...Array.isArray(c)?c:Object.values(c));typeof r.entryFileNames=="function"&&(r.entryFileNames=r.entryFileNames({name:r.name}));const d=r.entryFileNames.replace(/\.(.)?[jt]sx?$/,(u,v)=>`.d.${v||""}ts`);for await(let[u,v]of Object.entries(s)){if(o&&r.format==="cjs"){const y=Ut(v);y!==null&&(v=y.code)}const x=v.includes("from '")?"'":'"';(i===!0||i==="compatible")&&r.format==="cjs"&&this.emitFile({fileName:d.replace("[name]",_(m,u)).replace(".cts",".ts"),source:v.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(y,g,b,w)=>g+x+(w||b)+".d.ts"+x+";"),type:"asset"}),this.emitFile({fileName:d.replace("[name]",_(m,u)),source:v.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(y,g,b,w)=>g+x+(w||b)+(r.format==="cjs"?".d.cts":".d.mts")+x+";"),type:"asset"})}},transform:l}},"isolatedDeclarationsPlugin");var Vn=Object.defineProperty,Hn=f((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"n$a");const gt="export default ",Vt=Hn(e=>{const t=$o(e);return{...t,name:"packem:json",transform(i,o){const n=t.transform?.call(this,i,o);return n&&typeof n!="string"&&"code"in n&&n.code?.startsWith(gt)&&(n.code=n.code.replace(gt,"module.exports = ")),n}}},"JSONPlugin");var Gn=Object.defineProperty,he=f((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"i$7");class Ht{static{f(this,"WalkerBase")}static{he(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:he(()=>this.should_skip=!0,"skip"),remove:he(()=>this.should_remove=!0,"remove"),replace:he(t=>this.replacement=t,"replace")}}replace(t,i,o,n){t&&i&&(o!=null?t[i][o]=n:t[i]=n)}remove(t,i,o){t&&i&&(o!=null?t[i].splice(o,1):delete t[i])}}var Xn=Object.defineProperty,ce=f((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"c$h");class Yn extends Ht{static{f(this,"SyncWalker")}static{ce(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ce(()=>this.should_skip=!0,"skip"),remove:ce(()=>this.should_remove=!0,"remove"),replace:ce(o=>this.replacement=o,"replace")},this.enter=t,this.leave=i}visit(t,i,o,n){if(t){if(this.enter){const s=this.should_skip,p=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=p,this.replacement=l,r)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 p=s;for(let l=0;l<p.length;l+=1){const r=p[l];Le(r)&&(this.visit(r,t,a,l)||l--)}}else Le(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,p=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const l=this.should_remove;if(this.replacement=s,this.should_remove=p,l)return null}}return t}}function Le(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(Le,"n$9");ce(Le,"isNode");var Qn=Object.defineProperty,de=f((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"c$g");class Zn extends Ht{static{f(this,"AsyncWalker")}static{de(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:de(()=>this.should_skip=!0,"skip"),remove:de(()=>this.should_remove=!0,"remove"),replace:de(o=>this.replacement=o,"replace")},this.enter=t,this.leave=i}async visit(t,i,o,n){if(t){if(this.enter){const s=this.should_skip,p=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=p,this.replacement=l,r)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 p=s;for(let l=0;l<p.length;l+=1){const r=p[l];qe(r)&&(await this.visit(r,t,a,l)||l--)}}else qe(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,p=this.should_remove;this.replacement=null,this.should_remove=!1,await this.leave.call(this.context,t,i,o,n),this.replacement&&(t=this.replacement,this.replace(i,o,n,t)),this.should_remove&&this.remove(i,o,n);const l=this.should_remove;if(this.replacement=s,this.should_remove=p,l)return null}}return t}}function qe(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(qe,"a$f");de(qe,"isNode");var ea=Object.defineProperty,Gt=f((e,t)=>ea(e,"name",{value:t,configurable:!0}),"a$e");function Ze(e,{enter:t,leave:i}){return new Yn(t,i).visit(e,null)}f(Ze,"walk");Gt(Ze,"walk");async function ta(e,{enter:t,leave:i}){return await new Zn(t,i).visit(e,null)}f(ta,"asyncWalk");Gt(ta,"asyncWalk");var ia=Object.defineProperty,oa=f((e,t)=>ia(e,"name",{value:t,configurable:!0}),"u$7");const na=oa(({attributes:e,logger:t})=>{const i=ee([/\.[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(o,n){if(!i(n))return null;let a=null;try{a=this.parse(o,{allowReturnOutsideFunction:!0})}catch(l){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(l),null}let s=!1;const p=new Z(o);return Ze(a,{enter(l){if(l.type==="CallExpression"&&l.callee.type==="Identifier"&&l.callee.name==="jsx"){const r=l.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of r)for(const m of c.properties)m.type==="Property"&&m.key.type==="Literal"&&m.value.type==="Literal"&&e.includes(m.key.value)&&(p.overwrite(m.start-2,m.end,""),s=!0)}}}),s?{code:p.toString(),map:p.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var aa=Object.defineProperty,Xt=f((e,t)=>aa(e,"name",{value:t,configurable:!0}),"d$a");const sa=Xt(e=>{const t=[],i=[];return e.forEach(o=>{o.startsWith("(")?t.push(o):i.push(o)}),[...i.sort(),...t.sort()]},"sortLicenses"),Yt=Xt(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:o,marker:n,mode:a,packageName:s})=>Eo({thirdParty(p){const l=new Set,r=p.sort(({name:m},{name:d})=>(m||0)>(d||0)?1:(d||0)>(m||0)?-1:0).map(({author:m,contributors:d,license:u,licenseText:v,maintainers:x,name:y,repository:g})=>{let b="## "+y+`
35
- `;u&&(b+=`License: ${u}
36
- `);const w=new Set;for(const O of[m,...x,...d]){const h=typeof O=="string"?O:O?.name;h&&w.add(h)}return w.size>0&&(b+=`By: ${[...w].join(", ")}
37
- `),g&&(b+=`Repository: ${typeof g=="string"?g:g.url}
38
- `),v&&(b+=`
39
- `+v.trim().replaceAll(/\r\n|\r/g,`
23
+ `.trim(),Pn=On((e,t,o)=>{let i;return e.postcss&&typeof e.postcss.modules=="boolean"?i=e.postcss.modules:e.lightningcss&&typeof e.lightningcss.modules=="boolean"&&(i=e.lightningcss.modules),{async transform(n,a){let s=i;if(e.postcss&&typeof e.postcss.modules=="object"?s=Re(e.postcss.modules.include,a):e.lightningcss&&typeof e.lightningcss.modules=="object"&&(s=Re(e.lightningcss.modules.include,a)),e.autoModules&&s===void 0&&(s=Re(e.autoModules,a)),!s)return null;const{types:p}=this.getModuleInfo(a)?.meta.styles??{};return p===void 0||await De(a)&&(await No(a+".d.ts",`${Dn}
24
+ ${p}`),o.info({message:`Generated types for ${q(a).replace(t+"/","")}`,prefix:"dts:css-modules"}),this.addWatchFile(a+".d.ts")),null}}},"cssModulesTypes");var Nn=Object.defineProperty,Ce=f((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"t$9");const Cn=/\Wrequire(?:\.resolve)?\(/,_n=Ce((e,t)=>{if($o.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 o=!1,i=!1,n=!1;if(e.includes("__filename")&&(o=!0),e.includes("__dirname")&&(i=!0),Cn.test(e)&&(n=!0),!o&&!i&&!n)return null;const a=Jt(e).pop(),s=a?a.end:0,p=new Z(e);return p.appendRight(s,t(o,i,n)),{code:p.toString(),map:p.generateMap()}},"CJSToESM"),Mn=Ce((e,t,o)=>{let i="";return(e||t)&&(i+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
25
+ `),t&&(i+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
26
+ `),o&&(i+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
27
+ `),(e||t)&&(i+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
28
+ `),t&&(i+=`const __dirname = __cjs_path__.dirname(__filename);
29
+ `),o&&(i+=`const require = __cjs_mod__.createRequire(import.meta.url);
30
+ `),i},"generateCJSShim"),In=Ce((e,t,o)=>{let i="";return o&&(i+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
31
+ `),e&&(i+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
32
+ `),t&&(i+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
33
+ `),o&&(i+=`const require = __cjs_mod__.createRequire(import.meta.url);
34
+ `),i},"generateCJSShimNode20_11"),Tn=Ce((e,t)=>{const o=ee(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(i,n,a){if(a.format==="es"&&o(n.fileName)){let s=Mn;if(e.engines?.node){const p=Rt(e.engines.node);p&&p.major>=20&&p.minor>=11&&(s=In)}return _n(i,s)}return null}}},"esmShimCjsSyntaxPlugin");var An=Object.defineProperty,Fn=f((e,t)=>An(e,"name",{value:t,configurable:!0}),"m$a");const Rn=Fn(()=>({name:"packem:fix-dynamic-import-extension",renderChunk(e,t,o){return o.format==="es"||o.format==="cjs"?{code:e.replaceAll(/(import\(.*)(.ts)(['´"`]\))/g,"$1."+(o.format==="es"?"mjs":"cjs")+"$3"),map:null}:null}}),"fixDynamicImportExtension");var zn=Object.defineProperty,Jn=f((e,t)=>zn(e,"name",{value:t,configurable:!0}),"a$h");const Wn=Jn((e,t)=>{const o=e.replace(/^\.\//,""),i=t.replace(/^\.\//,"");if(i.startsWith(o))return e+i.slice(o.length);if(e.endsWith(t))return e;const n=e.split("/"),a=t.split("/");let s=n.length-1,p=a.length-1;for(;s>=0&&p>=0&&n[s]===a[p];)s--,p--;const l=n.slice(0,s).join("/"),r=a.slice(p).join("/");return l+(r?"/"+r:"")},"extendString");var Bn=Object.defineProperty,Ln=f((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"s$b");const qn=Ln((...e)=>{if(e.length===0)return"";if(e.length===1)return A(e[0]);e=e.map(n=>we(n));const[t,...o]=e;let i=t.split("/");for(const n of o){const a=n.split("/",i.length);let s=0;for(const p of a)if(p===i[s])s+=1;else{i=i.slice(0,s);break}i=i.slice(0,s)}return i.length<=1&&i[0]===""?`/${i[0]}`:i.join("/")},"lowestCommonAncestor");var Un=Object.defineProperty,ze=f((e,t)=>Un(e,"name",{value:t,configurable:!0}),"m$8");const Kn=ze((e,t,o,i,n={})=>{const a=ee(n.include,n.exclude),s={},p=ze((r,c)=>{s[r.replace(Q,"")]=c},"addOutput");async function l(r,c){if(!a(c))return;let m;try{const v=await ji(r,{sourceFilename:c});m=JSON.parse(v.program)}catch{}if(m){const v=m.body.filter(b=>b.type==="ImportDeclaration"||b.type==="ExportAllDeclaration"||b.type==="ExportNamedDeclaration");for(const b of v){if(!b.source||Y(b.source.value).includes("."))continue;const g=await this.resolve(b.source.value,c);if(!(!g||g.external)&&(g.id.endsWith(".ts")||g.id.endsWith(".cts")||g.id.endsWith(".mts")||g.id.endsWith(".tsx")||g.id.endsWith(".ctsx")||g.id.endsWith(".mtsx"))){const x=g.id.replace(e+"/","");r=r.replaceAll('from "'+b.source.value+'"','from "'+Wn(b.source.value,x)+'"')}}}const{errors:d,sourceText:u}=await t(c,r);if(d.length>0){if(n.ignoreErrors){this.warn(d[0]);return}return this.error(d[0])}if(p(c,u),!m)return;const h=m.body.filter(v=>v.type==="ImportDeclaration"?v.importKind==="type"?!0:v.specifiers?.every(b=>b.type==="ImportSpecifier"&&b.importKind==="type"):v.type==="ExportNamedDeclaration"||v.type==="ExportAllDeclaration"?v.exportKind==="type"?!0:v.type==="ExportNamedDeclaration"&&v.specifiers?.every(b=>b.type==="ExportSpecifier"&&b.exportKind==="type"):!1);for await(const v of h){if(!v.source)continue;const b=await this.resolve(v.source.value,c);if(!b)return;const g=b.id;if(a(g)&&!s[g.replace(Q,"")])try{const x=await Ct(g);await l.call(this,x,g)}catch{}}}return f(l,"h"),ze(l,"transform"),{name:"packem:isolated-declarations",async renderStart(r,{input:c}){const m=qn(...Array.isArray(c)?c:Object.values(c));typeof r.entryFileNames=="function"&&(r.entryFileNames=r.entryFileNames({name:r.name}));const d=r.entryFileNames.replace(/\.(.)?[jt]sx?$/,(u,h)=>`.d.${h||""}ts`);for await(let[u,h]of Object.entries(s)){if(i&&r.format==="cjs"){const b=qt(h);b!==null&&(h=b.code)}const v=h.includes("from '")?"'":'"';(o===!0||o==="compatible")&&r.format==="cjs"&&this.emitFile({fileName:d.replace("[name]",_(m,u)).replace(".cts",".ts"),source:h.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(b,g,x,k)=>g+v+(k||x)+".d.ts"+v+";"),type:"asset"}),this.emitFile({fileName:d.replace("[name]",_(m,u)),source:h.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(b,g,x,k)=>g+v+(k||x)+(r.format==="cjs"?".d.cts":".d.mts")+v+";"),type:"asset"})}},transform:l}},"isolatedDeclarationsPlugin");var Vn=Object.defineProperty,Hn=f((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"n$a");const gt="export default ",Kt=Hn(e=>{const t=$i(e);return{...t,name:"packem:json",transform(o,i){const n=t.transform?.call(this,o,i);return n&&typeof n!="string"&&"code"in n&&n.code?.startsWith(gt)&&(n.code=n.code.replace(gt,"module.exports = ")),n}}},"JSONPlugin");var Gn=Object.defineProperty,he=f((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"i$7");class Vt{static{f(this,"WalkerBase")}static{he(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:he(()=>this.should_skip=!0,"skip"),remove:he(()=>this.should_remove=!0,"remove"),replace:he(t=>this.replacement=t,"replace")}}replace(t,o,i,n){t&&o&&(i!=null?t[o][i]=n:t[o]=n)}remove(t,o,i){t&&o&&(i!=null?t[o].splice(i,1):delete t[o])}}var Xn=Object.defineProperty,ce=f((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"c$g");class Yn extends Vt{static{f(this,"SyncWalker")}static{ce(this,"SyncWalker")}constructor(t,o){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ce(()=>this.should_skip=!0,"skip"),remove:ce(()=>this.should_remove=!0,"remove"),replace:ce(i=>this.replacement=i,"replace")},this.enter=t,this.leave=o}visit(t,o,i,n){if(t){if(this.enter){const s=this.should_skip,p=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,o,i,n),this.replacement&&(t=this.replacement,this.replace(o,i,n,t)),this.should_remove&&this.remove(o,i,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=p,this.replacement=l,r)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 p=s;for(let l=0;l<p.length;l+=1){const r=p[l];Ue(r)&&(this.visit(r,t,a,l)||l--)}}else Ue(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,p=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,o,i,n),this.replacement&&(t=this.replacement,this.replace(o,i,n,t)),this.should_remove&&this.remove(o,i,n);const l=this.should_remove;if(this.replacement=s,this.should_remove=p,l)return null}}return t}}function Ue(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(Ue,"n$9");ce(Ue,"isNode");var Qn=Object.defineProperty,de=f((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"c$f");class Zn extends Vt{static{f(this,"AsyncWalker")}static{de(this,"AsyncWalker")}constructor(t,o){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:de(()=>this.should_skip=!0,"skip"),remove:de(()=>this.should_remove=!0,"remove"),replace:de(i=>this.replacement=i,"replace")},this.enter=t,this.leave=o}async visit(t,o,i,n){if(t){if(this.enter){const s=this.should_skip,p=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,o,i,n),this.replacement&&(t=this.replacement,this.replace(o,i,n,t)),this.should_remove&&this.remove(o,i,n);const r=this.should_skip,c=this.should_remove;if(this.should_skip=s,this.should_remove=p,this.replacement=l,r)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 p=s;for(let l=0;l<p.length;l+=1){const r=p[l];Ke(r)&&(await this.visit(r,t,a,l)||l--)}}else Ke(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,p=this.should_remove;this.replacement=null,this.should_remove=!1,await this.leave.call(this.context,t,o,i,n),this.replacement&&(t=this.replacement,this.replace(o,i,n,t)),this.should_remove&&this.remove(o,i,n);const l=this.should_remove;if(this.replacement=s,this.should_remove=p,l)return null}}return t}}function Ke(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}f(Ke,"a$f");de(Ke,"isNode");var ea=Object.defineProperty,Ht=f((e,t)=>ea(e,"name",{value:t,configurable:!0}),"a$e");function Ze(e,{enter:t,leave:o}){return new Yn(t,o).visit(e,null)}f(Ze,"walk");Ht(Ze,"walk");async function ta(e,{enter:t,leave:o}){return await new Zn(t,o).visit(e,null)}f(ta,"asyncWalk");Ht(ta,"asyncWalk");var oa=Object.defineProperty,ia=f((e,t)=>oa(e,"name",{value:t,configurable:!0}),"u$8");const na=ia(({attributes:e,logger:t})=>{const o=ee([/\.[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(i,n){if(!o(n))return null;let a=null;try{a=this.parse(i,{allowReturnOutsideFunction:!0})}catch(l){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(l),null}let s=!1;const p=new Z(i);return Ze(a,{enter(l){if(l.type==="CallExpression"&&l.callee.type==="Identifier"&&l.callee.name==="jsx"){const r=l.arguments.filter(c=>c.type==="ObjectExpression"&&Array.isArray(c.properties));for(const c of r)for(const m of c.properties)m.type==="Property"&&m.key.type==="Literal"&&m.value.type==="Literal"&&e.includes(m.key.value)&&(p.overwrite(m.start-2,m.end,""),s=!0)}}}),s?{code:p.toString(),map:p.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var aa=Object.defineProperty,Gt=f((e,t)=>aa(e,"name",{value:t,configurable:!0}),"d$a");const sa=Gt(e=>{const t=[],o=[];return e.forEach(i=>{i.startsWith("(")?t.push(i):o.push(i)}),[...o.sort(),...t.sort()]},"sortLicenses"),Xt=Gt(({dtsMarker:e,licenseFilePath:t,licenseTemplate:o,logger:i,marker:n,mode:a,packageName:s})=>Ei({thirdParty(p){const l=new Set,r=p.sort(({name:m},{name:d})=>(m||0)>(d||0)?1:(d||0)>(m||0)?-1:0).map(({author:m,contributors:d,license:u,licenseText:h,maintainers:v,name:b,repository:g})=>{let x="## "+b+`
35
+ `;u&&(x+=`License: ${u}
36
+ `);const k=new Set;for(const $ of[m,...v,...d]){const y=typeof $=="string"?$:$?.name;y&&k.add(y)}return k.size>0&&(x+=`By: ${[...k].join(", ")}
37
+ `),g&&(x+=`Repository: ${typeof g=="string"?g:g.url}
38
+ `),h&&(x+=`
39
+ `+h.trim().replaceAll(/\r\n|\r/g,`
40
40
  `).replaceAll(`<!-- ${n} -->`,"").replaceAll(e?`<!-- ${e} -->`:"","").replaceAll(`<!-- /${n} -->`,"").replaceAll(e?`<!-- /${e} -->`:"","").trim().split(`
41
- `).map(O=>O?`> ${O}`:">").join(`
41
+ `).map($=>$?`> ${$}`:">").join(`
42
42
  `)+`
43
- `),u&&l.add(u),b}).join(`
43
+ `),u&&l.add(u),x}).join(`
44
44
  ---------------------------------------
45
45
 
46
- `);if(r===""){o.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=i(sa(l),r,s);try{const m=Ve(t),d=So(m,n,c);if(!d){o.error({message:`Could not find the license marker: <!-- ${n} --><!-- /${n} --> in ${t}`,prefix:"plugin:license:"+a});return}m!==d&&(ne(t,d),o.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(m){o.error(m)}}}),"license");var ra=Object.defineProperty,pa=f((e,t)=>ra(e,"name",{value:t,configurable:!0}),"r$9");const la=pa(()=>({async generateBundle(e,t){const i=[];for(const n of this.getModuleIds()){const a=this.getModuleInfo(n);if(a!=null&&!a.isExternal)for(const s of a.importedIds)i.push({source:n,target:s})}if(Array.isArray(i)&&i.length===0)return;const o=Object.keys(t);this.emitFile({fileName:`metafile-${o[0].replace(Q,"")}-${e.format}.json`,source:JSON.stringify(i,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var ca=Object.defineProperty,da=f((e,t)=>ca(e,"name",{value:t,configurable:!0}),"g$5");let vt=!1;const ma=da((e,t,i,o,n,a)=>{if(a!=="*"&&no(ao(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle(){vt||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:node10-compatibility"}),vt=!0);const s={};for(const r of t)for(const c of r.exportKey)c.includes("/*")?s[c]=["./"+k(i,A(r.name),"*.d.ts")]:s[c]=[...s[c]??[],"./"+k(i,r.name+".d.ts")];const p=k(o,"package.json"),l=Ci(p);n==="file"&&Object.keys(s).length>0?(_i(p,{...l,typesVersions:{...l.typesVersions,[a]:s}},{detectIndent:!0}),e.info({message:'Your package.json "typesVersions" field has been updated.',prefix:"plugin:node10-compatibility"})):Object.keys(s).length>0&&e.info({message:`Please add the following field into your package.json to enable node 10 compatibility:
46
+ `);if(r===""){i.info({message:"No dependencies license information found.",prefix:"plugin:license:"+a});return}const c=o(sa(l),r,s);try{const m=Ge(t),d=Si(m,n,c);if(!d){i.error({message:`Could not find the license marker: <!-- ${n} --><!-- /${n} --> in ${t}`,prefix:"plugin:license:"+a});return}m!==d&&(ne(t,d),i.info({message:`${t} updated.`,prefix:"plugin:license:"+a}))}catch(m){i.error(m)}}}),"license");var ra=Object.defineProperty,pa=f((e,t)=>ra(e,"name",{value:t,configurable:!0}),"u$7");const la=pa(()=>({async generateBundle(e,t){const o=[];for(const n of this.getModuleIds()){const a=this.getModuleInfo(n);if(a!=null&&!a.isExternal)for(const s of a.importedIds)o.push({source:n,target:s})}if(Array.isArray(o)&&o.length===0)return;const i=Object.keys(t);this.emitFile({fileName:`metafile-${i[0].replace(Q,"")}-${e.format}.json`,source:JSON.stringify(o,null,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var ca=Object.defineProperty,da=f((e,t)=>ca(e,"name",{value:t,configurable:!0}),"g$6");let vt=!1;const ma=da((e,t,o,i,n,a)=>{if(a!=="*"&&ai(si(a))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");return{name:"packem:node10-compatibility",writeBundle(){vt||(e.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:node10-compatibility"}),vt=!0);const s={};for(const r of t)for(const c of r.exportKey)c.includes("/*")?s[c]=["./"+w(o,A(r.name),"*.d.ts")]:s[c]=[...s[c]??[],"./"+w(o,r.name+".d.ts")];const p=w(i,"package.json"),l=Co(p);n==="file"&&Object.keys(s).length>0?(_o(p,{...l,typesVersions:{...l.typesVersions,[a]:s}},{detectIndent:!0}),e.info({message:'Your package.json "typesVersions" field has been updated.',prefix:"plugin:node10-compatibility"})):Object.keys(s).length>0&&e.info({message:`Please add the following field into your package.json to enable node 10 compatibility:
47
47
 
48
48
  ${JSON.stringify({typesVersions:{"*":s}},null,4)}
49
- `,prefix:"plugin:node10-compatibility"})}}},"node10CompatibilityPlugin");var ua=Object.defineProperty,Qt=f((e,t)=>ua(e,"name",{value:t,configurable:!0}),"d$9");const pe=Qt(e=>e.handler||e,"getHandler"),I=Qt((e,t,i="")=>({...e,async buildEnd(o){e.buildEnd&&await pe(e.buildEnd).call(this,o)},async buildStart(o){e.buildStart&&await pe(e.buildStart).call(this,o)},async load(o){if(!e.load)return null;const n=k(i,e.name),a=k("load",H(o));if(t.has(a,n))return await t.get(a,n);const s=await pe(e.load).call(this,o);return t.set(a,s,n),s},name:`cached(${e.name})`,async resolveId(o,n,a){if(!e.resolveId)return null;const s=k(i,e.name),p=k("resolveId",H(o),n?H(n):"",H(JSON.stringify(a)));if(t.has(p,s))return await t.get(p,s);const l=await pe(e.resolveId).call(this,o,n,a);return t.set(p,l,s),l},async transform(o,n){if(!e.transform)return null;const a=k(i,e.name),s=k("transform",H(n),H(o));if(t.has(s,a))return await t.get(s,a);const p=await pe(e.transform).call(this,o,n);return t.set(s,p,a),p}}),"cachingPlugin");var fa=Object.defineProperty,ga=f((e,t)=>fa(e,"name",{value:t,configurable:!0}),"n$8");const va=ga(()=>({name:"packem:prepend-directive",transform:{handler(e,t){const i=this.getModuleInfo(t);if(i?.meta.preserveDirectives){const o=i.meta.preserveDirectives.directives[0];if(o)return`'${o.value}';
50
- `+e}return null},order:"post"}}),"prependDirectivePlugin");var ha=Object.defineProperty,ya=f((e,t)=>ha(e,"name",{value:t,configurable:!0}),"c$c");const xa=ya(({directiveRegex:e,exclude:t=[],include:i=[],logger:o})=>{const n={},a={},s=ee(i,t);return{name:"packem:preserve-directives",onLog(p,l){return l.code==="MODULE_LEVEL_DIRECTIVE"&&p==="warn"?!1:null},renderChunk:{handler(p,l,{sourcemap:r}){const c=l.moduleIds.map(u=>n[u]?n[u]:null).reduce((u,v)=>(v&&v.forEach(x=>{u.add(x)}),u),new Set),m=new Z(p);c.size>0&&(o.debug({message:`directives for chunk "${l.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${[...c].map(u=>`'${u}';`).join(`
49
+ `,prefix:"plugin:node10-compatibility"})}}},"node10CompatibilityPlugin");var ua=Object.defineProperty,Yt=f((e,t)=>ua(e,"name",{value:t,configurable:!0}),"d$9");const pe=Yt(e=>e.handler||e,"getHandler"),I=Yt((e,t,o="")=>({...e,async buildEnd(i){e.buildEnd&&await pe(e.buildEnd).call(this,i)},async buildStart(i){e.buildStart&&await pe(e.buildStart).call(this,i)},async load(i){if(!e.load)return null;const n=w(o,e.name),a=w("load",G(i));if(t.has(a,n))return await t.get(a,n);const s=await pe(e.load).call(this,i);return t.set(a,s,n),s},name:`cached(${e.name})`,async resolveId(i,n,a){if(!e.resolveId)return null;const s=w(o,e.name),p=w("resolveId",G(i),n?G(n):"",G(JSON.stringify(a)));if(t.has(p,s))return await t.get(p,s);const l=await pe(e.resolveId).call(this,i,n,a);return t.set(p,l,s),l},async transform(i,n){if(!e.transform)return null;const a=w(o,e.name),s=w("transform",G(n),G(i));if(t.has(s,a))return await t.get(s,a);const p=await pe(e.transform).call(this,i,n);return t.set(s,p,a),p}}),"cachingPlugin");var fa=Object.defineProperty,ga=f((e,t)=>fa(e,"name",{value:t,configurable:!0}),"n$8");const va=ga(()=>({name:"packem:prepend-directive",transform:{handler(e,t){const o=this.getModuleInfo(t);if(o?.meta.preserveDirectives){const i=o.meta.preserveDirectives.directives[0];if(i)return`'${i.value}';
50
+ `+e}return null},order:"post"}}),"prependDirectivePlugin");var ha=Object.defineProperty,ya=f((e,t)=>ha(e,"name",{value:t,configurable:!0}),"c$b");const xa=ya(({directiveRegex:e,exclude:t=[],include:o=[],logger:i})=>{const n={},a={},s=ee(o,t);return{name:"packem:preserve-directives",onLog(p,l){return l.code==="MODULE_LEVEL_DIRECTIVE"&&p==="warn"?!1:null},renderChunk:{handler(p,l,{sourcemap:r}){const c=l.moduleIds.map(u=>n[u]?n[u]:null).reduce((u,h)=>(h&&h.forEach(v=>{u.add(v)}),u),new Set),m=new Z(p);c.size>0&&(i.debug({message:`directives for chunk "${l.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${[...c].map(u=>`'${u}';`).join(`
51
51
  `)}
52
- `));let d;return l.facadeModuleId&&typeof a[l.facadeModuleId]=="string"&&(d=a[l.facadeModuleId]),d&&(o.debug({message:`shebang for chunk "${l.fileName}" is preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${d}
53
- `)),c.size===0&&d===void 0?null:{code:m.toString(),map:r?m.generateMap({hires:!0}):null}},order:"post"},transform(p,l){if(!s(l))return null;let r=!1;const c=new Z(p);if(p.startsWith("#")&&p[1]==="!"){let d=0;for(let u=2,v=p.length;u<v;u++){const x=p.codePointAt(u);if(x===10||x===13||x===8232||x===8233){d=u;break}}d&&(a[l]=p.slice(0,d),c.remove(0,d+1),r=!0,o.debug({message:`shebang for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}let m=null;try{m=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${l}" and extract the directives.`}),o.warn(d),null}if(m.type!=="Program")return null;for(const d of m.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let u=null;"directive"in d?u=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(u=d.expression.value),u!=="use strict"&&u&&(n[l]||=new Set,n[l].add(u),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),r=!0),o.debug({message:`directive "${u}" for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}return r?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[l]??[]],shebang:a[l]??null}}}:null}}},"preserveDirectives");var ba=Object.defineProperty,wa=f((e,t)=>ba(e,"name",{value:t,configurable:!0}),"n$7");const ka=wa(e=>{const t=ee(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,o){return!t(o)&&!o.includes("?raw")?null:(o.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var ja=Object.defineProperty,$a=f((e,t)=>ja(e,"name",{value:t,configurable:!0}),"r$8");const Zt=$a(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return Do(e)}}),"resolveFileUrl");var Ea=Object.defineProperty,Ne=f((e,t)=>Ea(e,"name",{value:t,configurable:!0}),"i$5");const $e=/^#![^\n]*/,Ue=Ne(async e=>{await Ui(e,493).catch(()=>{})},"makeExecutable"),Sa=Ne((e,t)=>({name:"packem:shebang",renderChunk:{handler(i,o,n){if(!o.isEntry||!o.facadeModuleId)return null;const a=i.startsWith("#")&&i[1]==="!";if(a&&t.replace)return i.replace($e,t.shebang+`
54
- `);if(a)return null;if(e.includes(o.name)){const s=new Z(i);return s.prepend(t.shebang+`
55
- `),{code:s.toString(),map:n.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(i,o){for(const[n,a]of Object.entries(o))if(a.type==="chunk"&&$e.test(a.code)&&i.dir){const s=$(i.dir,n);await Ue(s)}}}),"shebangPlugin"),Oa=Ne(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace($e,"")}}),"removeShebangPlugin"),Da=Ne((e,t=`
56
- `)=>{const i=$e.exec(e);return i?i+t:""},"getShebang");var Pa=Object.defineProperty,te=f((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"r$7");const Na=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,Ca=/MIT License|MIT license|BSD license/,_a=/\n{2,}/g,Ma=/\b(\w+)\$\d+\b/g,Ia=/[-/\\^$*+?.()|[\]{}]/g,Ta=te(e=>e.replaceAll(Ia,"\\$&"),"escapeRegex"),Aa=te(e=>[...new Set(e)],"unique"),Fa=te(e=>e.replaceAll(Na,t=>Ca.test(t)?"":t).replaceAll(_a,`
52
+ `));let d;return l.facadeModuleId&&typeof a[l.facadeModuleId]=="string"&&(d=a[l.facadeModuleId]),d&&(i.debug({message:`shebang for chunk "${l.fileName}" is preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${d}
53
+ `)),c.size===0&&d===void 0?null:{code:m.toString(),map:r?m.generateMap({hires:!0}):null}},order:"post"},transform(p,l){if(!s(l))return null;let r=!1;const c=new Z(p);if(p.startsWith("#")&&p[1]==="!"){let d=0;for(let u=2,h=p.length;u<h;u++){const v=p.codePointAt(u);if(v===10||v===13||v===8232||v===8233){d=u;break}}d&&(a[l]=p.slice(0,d),c.remove(0,d+1),r=!0,i.debug({message:`shebang for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}let m=null;try{m=this.parse(c.toString(),{allowReturnOutsideFunction:!0})}catch(d){return this.warn({code:"PARSE_ERROR",message:`failed to parse "${l}" and extract the directives.`}),i.warn(d),null}if(m.type!=="Program")return null;for(const d of m.body.filter(Boolean)){if(d.type!=="ExpressionStatement")break;let u=null;"directive"in d?u=d.directive:d.expression.type==="Literal"&&typeof d.expression.value=="string"&&e.test(d.expression.value)&&(u=d.expression.value),u!=="use strict"&&u&&(n[l]||=new Set,n[l].add(u),"start"in d&&typeof d.start=="number"&&"end"in d&&typeof d.end=="number"&&(c.remove(d.start,d.end),r=!0),i.debug({message:`directive "${u}" for module "${l}" is preserved.`,prefix:"plugin:preserve-directives"}))}return r?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[l]??[]],shebang:a[l]??null}}}:null}}},"preserveDirectives");var ba=Object.defineProperty,wa=f((e,t)=>ba(e,"name",{value:t,configurable:!0}),"n$7");const ka=wa(e=>{const t=ee(e.include,e.exclude);return{async load(o){return o.includes("?raw")?await this.load({id:o.replace(/\?raw$/,"")}):null},name:"packem:raw",transform(o,i){return!t(i)&&!i.includes("?raw")?null:(i.includes("?raw")||(o=`export default ${JSON.stringify(o)}`),{code:o,map:{mappings:""}})}}},"rawPlugin");var ja=Object.defineProperty,$a=f((e,t)=>ja(e,"name",{value:t,configurable:!0}),"r$8");const Qt=$a(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return Di(e)}}),"resolveFileUrl");var Ea=Object.defineProperty,_e=f((e,t)=>Ea(e,"name",{value:t,configurable:!0}),"i$5");const $e=/^#![^\n]*/,Ve=_e(async e=>{await Uo(e,493).catch(()=>{})},"makeExecutable"),Sa=_e((e,t)=>({name:"packem:shebang",renderChunk:{handler(o,i,n){if(!i.isEntry||!i.facadeModuleId)return null;const a=o.startsWith("#")&&o[1]==="!";if(a&&t.replace)return o.replace($e,t.shebang+`
54
+ `);if(a)return null;if(e.includes(i.name)){const s=new Z(o);return s.prepend(t.shebang+`
55
+ `),{code:s.toString(),map:n.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(o,i){for(const[n,a]of Object.entries(i))if(a.type==="chunk"&&$e.test(a.code)&&o.dir){const s=E(o.dir,n);await Ve(s)}}}),"shebangPlugin"),Oa=_e(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace($e,"")}}),"removeShebangPlugin"),Da=_e((e,t=`
56
+ `)=>{const o=$e.exec(e);return o?o+t:""},"getShebang");var Pa=Object.defineProperty,te=f((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"r$7");const Na=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,Ca=/MIT License|MIT license|BSD license/,_a=/\n{2,}/g,Ma=/\b(\w+)\$\d+\b/g,Ia=/[-/\\^$*+?.()|[\]{}]/g,Ta=te(e=>e.replaceAll(Ia,"\\$&"),"escapeRegex"),Aa=te(e=>[...new Set(e)],"unique"),Fa=te(e=>e.replaceAll(Na,t=>Ca.test(t)?"":t).replaceAll(_a,`
57
57
 
58
- `),"cleanUnnecessaryComments"),ht=new Map;function ei(e,t,{identifierReplacements:i},o){const n=Wt(e);for(const s in i){const p=n.find(r=>r.specifier===s&&r.imports.includes("{"));if(!p){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const l=i[s];for(const r in l){if(!p.imports.includes(r))throw new Error(`${t.fileName} does not import "${r}" from "${s}" for replacement`);const c=l[r],m=Ta(r);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${m},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${m}\\b`,"g"),c)}}const a=Aa(Array.from(e.matchAll(Ma),s=>s[0]));if(a.length>0){const s=a.map(l=>`
59
- - ${l}`).join(""),p=t.fileName.replace(/\.[^/.]+$/,"");ht.has(p)||o.warn({message:`${t.fileName} contains confusing identifier names${s}
58
+ `),"cleanUnnecessaryComments"),ht=new Map;function Zt(e,t,{identifierReplacements:o},i){const n=Jt(e);for(const s in o){const p=n.find(r=>r.specifier===s&&r.imports.includes("{"));if(!p){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const l=o[s];for(const r in l){if(!p.imports.includes(r))throw new Error(`${t.fileName} does not import "${r}" from "${s}" for replacement`);const c=l[r],m=Ta(r);c.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${m},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${m}\\b`,"g"),c)}}const a=Aa(Array.from(e.matchAll(Ma),s=>s[0]));if(a.length>0){const s=a.map(l=>`
59
+ - ${l}`).join(""),p=t.fileName.replace(/\.[^/.]+$/,"");ht.has(p)||i.warn({message:`${t.fileName} contains confusing identifier names${s}
60
60
 
61
- To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),ht.set(p,!0)}return e}f(ei,"I");te(ei,"replaceConfusingTypeNames");const Ra=te((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 ti(e,t){if(e.includes("@internal")){const i=new Z(e),o=Po(e,{plugins:["typescript"],sourceType:"module"});if(Ze(o,{enter(n){Ra(i,n)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}f(ti,"S$1");te(ti,"stripInternalTypes");const za=te((e,t)=>({name:"packem:patch-types",renderChunk(i,o){return i=ei.call(this,i,o,e,t),i=ti.call(this,i,o),i=Fa(i),i},resolveId(i){return i.startsWith("types/")?{external:!0,id:"../../"+(i.endsWith(".js")?i:i+".js")}:null}}),"patchTypescriptTypes");var Ja=Object.defineProperty,ii=f((e,t)=>Ja(e,"name",{value:t,configurable:!0}),"m$7");const oi=ii((e,t=!0)=>{if(!e)return null;const{config:i,path:o}=e;if(!i.compilerOptions)return null;const{baseUrl:n,paths:a}=i.compilerOptions;if(!n)return null;const s=$(A(o),n),p=[];if(a)for(const[l,r]of Object.entries(a)){let c;l==="@"||l==="~"||l==="#"?c=new RegExp(`^${l}/(.+)$`):c=new RegExp(`^${[...l].map(d=>d==="*"?"(.+)":d.replace(/[\\^$*+?.()|[\]{}]/,"\\$&")).join("")}$`);let m=0;for(const d of r){const u=[...q($(s,d))].map(v=>v==="*"?"$"+(++m+""):v==="$"?"$$":v).join("");p.push({find:c,replacement:u})}}return t&&p.push({find:/^(?!\.*\/|\.*$|\w:)(.+)$/,replacement:`${[...q(s)].map(l=>l==="$"?"$$":l).join("")}/$1`}),p},"getConfigAlias"),ni=ii((e,t)=>{const i=oi(e);return{name:"packem:resolve-tsconfig-paths",async resolveId(o,n,a){if(!i||o.includes("\0"))return null;for(const{find:s,replacement:p}of i)if(s.test(o)){const l=o.replace(s,p),r=await this.resolve(l,n,{skipSelf:!0,...a});if(r)return t.debug({message:`Resolved ${o} to ${r.id} using paths from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-paths"}),r.id}return null}}},"resolveTsconfigPaths");var Wa=Object.defineProperty,ai=f((e,t)=>Wa(e,"name",{value:t,configurable:!0}),"u$5");const Ba=ai((e,t)=>{if(!t)return null;const{config:i,path:o}=t;if(!i.compilerOptions)return null;const{rootDirs:n}=i.compilerOptions;if(!n)return null;const a=[];for(const s of n){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${o}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${o}.`);a.push($(e,s))}return a},"getRootDirectories"),si=ai((e,t,i)=>{const o=Ba(e,i);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(n,a,s){if(o===null||o.length===0)return null;if(n.startsWith("."))for(const p of o){const l=k(p,n),r=await this.resolve(l,a,{skipSelf:!0,...s});if(r)return t.debug({message:`Resolved ${n} to ${r.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),r.id}return null}}},"resolveTsconfigRootDirectories");var La=Object.defineProperty,qa=f((e,t)=>La(e,"name",{value:t,configurable:!0}),"r$6");const ri=qa(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,i,o){return e.test(t)&&i?await this.resolve(t.replace(/js(x?)$/,"ts$1"),i,o):null}}},"resolveTypescriptMjsCts"),pi={"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.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.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.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.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(pi);const Ua=new xo(bo,pi)._freeze();var Ka=Object.defineProperty,et=f((e,t)=>Ka(e,"name",{value:t,configurable:!0}),"u$4");const Va=et(async(e,t)=>{await new Promise((i,o)=>{const n=Gi(e);n.on("error",o);const a=Xi(t);a.on("error",o),a.on("finish",i),n.pipe(a)})},"copy"),Ha=et(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"),Ga=et(({destDir:e,emitFiles:t,exclude:i,fileName:o,include:n,limit:a,publicPath:s,sourceDir:p})=>{const l=ee(n,i),r={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??A(c.file??"");await at(m),await Promise.all(Object.keys(r).map(async d=>{const u=r[d],v=k(m,A(u));await at(v),await Va(d,k(m,u))}))},async load(c){if(!l(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([Xe(c),Ki(c)]);let u;if(a&&m.size>a||a===0){const v=No.createHash("sha1").update(d).digest("hex").slice(0,16),x=Ge(c),y=Y(c,x),g=p?_(p,A(c)):Y(A(c)),b=o.replaceAll("[hash]",v).replaceAll("[extname]",x).replaceAll("[dirname]",g===""?"":`${g}/`).replaceAll("[name]",y);u=k(s??"",b),r[c]=b}else{const v=Ua.getType(c);if(v===null)throw new Error(`Could not determine mimetype for ${c}`);const x=v==="image/svg+xml";u=x?Ha(d):d.toString("base64"),u=`data:${v}${x?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var Xa=Object.defineProperty,Ya=f((e,t)=>Xa(e,"name",{value:t,configurable:!0}),"s$8");const Qa=Ya(e=>{const t=Y(e).split(".");if(t.length>=2){const[i,o]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(Ye.includes(o)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var Za=Object.defineProperty,es=f((e,t)=>Za(e,"name",{value:t,configurable:!0}),"i$4");const Re=es(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var ts=Object.defineProperty,yt=f((e,t)=>ts(e,"name",{value:t,configurable:!0}),"d$8");const is=yt((e,t)=>{const i=new Map;return yt(function(o,n){const a=n.getModuleInfo(o);if(!a)return;const{isEntry:s}=a,p=a.meta,l=Re(p);if(!s){const r=i.get(o);if(r)return r;const c=Qa(o);if(c)return i.set(o,c),c}if(s){const r=n.getModuleIds();for(const c of r)n.getModuleInfo(c)&&Re(p)===l&&(e.has(c)||e.set(c,new Set),e.get(c).add([o,l]))}if(l&&!s&&e.has(o)){const r=[...e.get(o)];if(r.some(([m])=>{if(t.some(d=>d.path===m)){const d=n.getModuleInfo(m);return Re(d?d.meta:{})===l}return!1}))return;if(r.every(([,m])=>m===l))return i.has(o)?i.get(o):void 0;const c=Y(o,Ge(o))+"-"+l;return i.set(o,c),c}},"splitChunks")},"createSplitChunks");var os=Object.defineProperty,ns=f((e,t)=>os(e,"name",{value:t,configurable:!0}),"n$5");const X=ns((e,t)=>e.isDynamicEntry?`${so}/[name].${t}`:`${ro}/${e.name}-[hash].${t}`,"getChunkFilename");var as=Object.defineProperty,ss=f((e,t)=>as(e,"name",{value:t,configurable:!0}),"o$4");const rs=process.platform==="win32",xt=ss((e,t)=>{const i=rs?"\\":"/";for(let o of Array.isArray(e.names)?e.names:[]){if(o.includes("node_modules"+i+".pnpm"))return o=o.replace("node_modules"+i+".pnpm","external")+"."+t,o.replace("node_modules"+i,"");if(o.includes("node_modules"))return o.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var ps=Object.defineProperty,ls=f((e,t)=>ps(e,"name",{value:t,configurable:!0}),"p$2");const tt=ls((e,t)=>{let i={};if(e.pkg.name&&(i[e.pkg.name]=e.options.rootDir),e.pkg.imports){const{imports:o}=e.pkg;for(const n in o){if(n.startsWith("#"))continue;const a=o[n];typeof a=="string"&&(i[n]=k(e.options.rootDir,a))}}return i={...i,...e.options.alias},e.options.rollup.alias&&(Array.isArray(e.options.rollup.alias.entries)?Object.assign(i,Object.fromEntries(e.options.rollup.alias.entries.map(o=>[o.find,o.replacement]))):Object.assign(i,e.options.rollup.alias.entries??e.options.rollup.alias)),e.logger.debug({message:"Resolved aliases: "+JSON.stringify(i),prefix:t}),i},"resolveAliases");var cs=Object.defineProperty,T=f((e,t)=>cs(e,"name",{value:t,configurable:!0}),"n$3");const li=T((e,t)=>{const i=[],o=[],n=[];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"?o.push(a.plugin):n.push(a.plugin)}),[i,n,o]},"sortUserPlugins"),ds=T((e,t)=>{if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");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");let i="node"+Ei.node.split(".")[0];if(t.pkg.engines?.node){const o=zt(t.pkg.engines.node);o&&(i="node"+o.major)}if(t.options.rollup.esbuild.target){const o=ue(t.options.rollup.esbuild.target);o.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...ue(i),...o])])}else t.options.rollup.esbuild.target=ue(i);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"),ci=T((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(_($(),e.id))}"
61
+ To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),ht.set(p,!0)}return e}f(Zt,"I");te(Zt,"replaceConfusingTypeNames");const Ra=te((e,t)=>{if(t.leadingComments?.some(o=>o.type==="CommentBlock"&&o.value.includes("@internal"))){const o=e.original[t.end]===","?t.end+1:t.end;return e.remove(t.leadingComments[0].start,o),!0}return!1},"removeInternal");function eo(e,t){if(e.includes("@internal")){const o=new Z(e),i=Pi(e,{plugins:["typescript"],sourceType:"module"});if(Ze(i,{enter(n){Ra(o,n)&&this.skip()}}),e=o.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}f(eo,"S$1");te(eo,"stripInternalTypes");const za=te((e,t)=>({name:"packem:patch-types",renderChunk(o,i){return o=Zt.call(this,o,i,e,t),o=eo.call(this,o,i),o=Fa(o),o},resolveId(o){return o.startsWith("types/")?{external:!0,id:"../../"+(o.endsWith(".js")?o:o+".js")}:null}}),"patchTypescriptTypes");var Ja=Object.defineProperty,to=f((e,t)=>Ja(e,"name",{value:t,configurable:!0}),"m$7");const oo=to((e,t=!0)=>{if(!e)return null;const{config:o,path:i}=e;if(!o.compilerOptions)return null;const{baseUrl:n,paths:a}=o.compilerOptions;if(!n)return null;const s=E(A(i),n),p=[];if(a)for(const[l,r]of Object.entries(a)){let c;l==="@"||l==="~"||l==="#"?c=new RegExp(`^${l}/(.+)$`):c=new RegExp(`^${[...l].map(d=>d==="*"?"(.+)":d.replace(/[\\^$*+?.()|[\]{}]/,"\\$&")).join("")}$`);let m=0;for(const d of r){const u=[...q(E(s,d))].map(h=>h==="*"?"$"+(++m+""):h==="$"?"$$":h).join("");p.push({find:c,replacement:u})}}return t&&p.push({find:/^(?!\.*\/|\.*$|\w:)(.+)$/,replacement:`${[...q(s)].map(l=>l==="$"?"$$":l).join("")}/$1`}),p},"getConfigAlias"),io=to((e,t)=>{const o=oo(e);return{name:"packem:resolve-tsconfig-paths",async resolveId(i,n,a){if(!o||i.includes("\0"))return null;for(const{find:s,replacement:p}of o)if(s.test(i)){const l=i.replace(s,p),r=await this.resolve(l,n,{skipSelf:!0,...a});if(r)return t.debug({message:`Resolved ${i} to ${r.id} using paths from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-paths"}),r.id}return null}}},"resolveTsconfigPaths");var Wa=Object.defineProperty,no=f((e,t)=>Wa(e,"name",{value:t,configurable:!0}),"u$5");const Ba=no((e,t)=>{if(!t)return null;const{config:o,path:i}=t;if(!o.compilerOptions)return null;const{rootDirs:n}=o.compilerOptions;if(!n)return null;const a=[];for(const s of n){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${i}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${i}.`);a.push(E(e,s))}return a},"getRootDirectories"),ao=no((e,t,o)=>{const i=Ba(e,o);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(n,a,s){if(i===null||i.length===0)return null;if(n.startsWith("."))for(const p of i){const l=w(p,n),r=await this.resolve(l,a,{skipSelf:!0,...s});if(r)return t.debug({message:`Resolved ${n} to ${r.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),r.id}return null}}},"resolveTsconfigRootDirectories");var La=Object.defineProperty,qa=f((e,t)=>La(e,"name",{value:t,configurable:!0}),"r$6");const so=qa(()=>{const e=/\.(?:[mc]?js|jsx)$/;return{name:"packem:resolve-typescript-mjs-cjs",async resolveId(t,o,i){return e.test(t)&&o?await this.resolve(t.replace(/js(x?)$/,"ts$1"),o,i):null}}},"resolveTypescriptMjsCts"),ro={"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.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.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.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.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(ro);const Ua=new xi(bi,ro)._freeze();var Ka=Object.defineProperty,et=f((e,t)=>Ka(e,"name",{value:t,configurable:!0}),"u$4");const Va=et(async(e,t)=>{await new Promise((o,i)=>{const n=Go(e);n.on("error",i);const a=Xo(t);a.on("error",i),a.on("finish",o),n.pipe(a)})},"copy"),Ha=et(e=>{let t=e.toString("utf8").replaceAll(/[\n\r]/g,"").replaceAll(" "," "),o;do o=t,t=t.replaceAll(/<!--(.*(?=-->))-->/g,"");while(t!==o);return encodeURIComponent(t.replaceAll("'","\\i")).replaceAll("(","%28").replaceAll(")","%29")},"encodeSVG"),Ga=et(({destDir:e,emitFiles:t,exclude:o,fileName:i,include:n,limit:a,publicPath:s,sourceDir:p})=>{const l=ee(n,o),r={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??A(c.file??"");await at(m),await Promise.all(Object.keys(r).map(async d=>{const u=r[d],h=w(m,A(u));await at(h),await Va(d,w(m,u))}))},async load(c){if(!l(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([Ye(c),Ko(c)]);let u;if(a&&m.size>a||a===0){const h=Ni.createHash("sha1").update(d).digest("hex").slice(0,16),v=Pe(c),b=Y(c,v),g=p?_(p,A(c)):Y(A(c)),x=i.replaceAll("[hash]",h).replaceAll("[extname]",v).replaceAll("[dirname]",g===""?"":`${g}/`).replaceAll("[name]",b);u=w(s??"",x),r[c]=x}else{const h=Ua.getType(c);if(h===null)throw new Error(`Could not determine mimetype for ${c}`);const v=h==="image/svg+xml";u=v?Ha(d):d.toString("base64"),u=`data:${h}${v?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var Xa=Object.defineProperty,Ya=f((e,t)=>Xa(e,"name",{value:t,configurable:!0}),"s$8");const Qa=Ya(e=>{const t=Y(e).split(".");if(t.length>=2){const[o,i]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(o)?.[1];if(Ne.includes(i)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var Za=Object.defineProperty,es=f((e,t)=>Za(e,"name",{value:t,configurable:!0}),"i$4");const Je=es(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var ts=Object.defineProperty,yt=f((e,t)=>ts(e,"name",{value:t,configurable:!0}),"d$8");const os=yt((e,t)=>{const o=new Map;return yt(function(i,n){const a=n.getModuleInfo(i);if(!a)return;const{isEntry:s}=a,p=a.meta,l=Je(p);if(!s){const r=o.get(i);if(r)return r;const c=Qa(i);if(c)return o.set(i,c),c}if(s){const r=n.getModuleIds();for(const c of r)n.getModuleInfo(c)&&Je(p)===l&&(e.has(c)||e.set(c,new Set),e.get(c).add([i,l]))}if(l&&!s&&e.has(i)){const r=[...e.get(i)];if(r.some(([m])=>{if(t.some(d=>d.path===m)){const d=n.getModuleInfo(m);return Je(d?d.meta:{})===l}return!1}))return;if(r.every(([,m])=>m===l))return o.has(i)?o.get(i):void 0;const c=Y(i,Pe(i))+"-"+l;return o.set(i,c),c}},"splitChunks")},"createSplitChunks");var is=Object.defineProperty,ns=f((e,t)=>is(e,"name",{value:t,configurable:!0}),"n$5");const X=ns((e,t)=>e.isDynamicEntry?`${ri}/[name].${t}`:`${pi}/${e.name}-[hash].${t}`,"getChunkFilename");var as=Object.defineProperty,ss=f((e,t)=>as(e,"name",{value:t,configurable:!0}),"o$4");const rs=process.platform==="win32",xt=ss((e,t)=>{const o=rs?"\\":"/";for(let i of Array.isArray(e.names)?e.names:[]){if(i.includes("node_modules"+o+".pnpm"))return i=i.replace("node_modules"+o+".pnpm","external")+"."+t,i.replace("node_modules"+o,"");if(i.includes("node_modules"))return i.replace("node_modules","external")+"."+t}return"[name]."+t},"getEntryFileNames");var ps=Object.defineProperty,ls=f((e,t)=>ps(e,"name",{value:t,configurable:!0}),"p$2");const tt=ls((e,t)=>{let o={};if(e.pkg.name&&(o[e.pkg.name]=e.options.rootDir),e.pkg.imports){const{imports:i}=e.pkg;for(const n in i){if(n.startsWith("#"))continue;const a=i[n];typeof a=="string"&&(o[n]=w(e.options.rootDir,a))}}return o={...o,...e.options.alias},e.options.rollup.alias&&(Array.isArray(e.options.rollup.alias.entries)?Object.assign(o,Object.fromEntries(e.options.rollup.alias.entries.map(i=>[i.find,i.replacement]))):Object.assign(o,e.options.rollup.alias.entries??e.options.rollup.alias)),e.logger.debug({message:"Resolved aliases: "+JSON.stringify(o),prefix:t}),o},"resolveAliases");var cs=Object.defineProperty,T=f((e,t)=>cs(e,"name",{value:t,configurable:!0}),"n$3");const po=T((e,t)=>{const o=[],i=[],n=[];return e&&e.filter(Boolean).filter(a=>a.type===t?!0:t==="build"&&a.type===void 0).forEach(a=>{a.enforce==="pre"?o.push(a.plugin):a.enforce==="post"?i.push(a.plugin):n.push(a.plugin)}),[o,n,i]},"sortUserPlugins"),ds=T((e,t)=>{if(e==="esbuild"){if(!t.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");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");let o="node"+Eo.node.split(".")[0];if(t.pkg.engines?.node){const i=Rt(t.pkg.engines.node);i&&(o="node"+i.major)}if(t.options.rollup.esbuild.target){const i=ue(t.options.rollup.esbuild.target);i.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...ue(o),...i])])}else t.options.rollup.esbuild.target=ue(o);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"),lo=T((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(_(E(),e.id))}"
62
62
  Is the module installed? Note:
63
63
  ↳ to inline a module into your bundle, install it to "devDependencies".
64
- ↳ 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"),bt=new Map,ze=new Map,di=T((e,t,i)=>{const o=oi(e.tsconfig,!1);return{external(n){n=to(n,t);const a=Bt(n);if(Be(e.options.externals,a)||Be(e.options.externals,n))return!0;const{pkg:s}=e;if(n.startsWith(".")||He(n)||/src[/\\]/.test(n)||s.name&&n.startsWith(s.name))return!1;if(s.imports)for(const[p,l]of Object.entries(s.imports)){if(p===n)return!1;if(p.includes("*")){let r;ze.has(p)?r=ze.get(p):(r=Yi(k(e.options.rootDir,l.replace("/*","")),{withFileTypes:!0}).filter(c=>c.isFile()).map(c=>c.name),ze.set(p,r));for(const c of r)if(c.replace(Q,"")===n.replace(Q,"").replace("#",""))return!1}}if(o){for(const{find:p}of o)if(p.test(n))return e.logger.debug({message:`Resolved alias ${n} to ${p.source}`,prefix:i}),!1}return bt.has(n)||e.logger.info({message:'Inlined implicit external "'+D(n)+'". If this is incorrect, add it to the "externals" option.',prefix:i}),bt.set(n,!0),!1},input:Object.fromEntries(e.options.entries.map(n=>[n.name,$(e.options.rootDir,n.input)])),logLevel:e.options.debug?"debug":"info",onLog:T((n,a)=>{let s=a.message;switch(a.stack&&(s=`${s}
65
- ${a.stack}`),n){case"info":{e.logger.info({message:s,prefix:i+(a.plugin?":plugin:"+a.plugin:"")});return}case"warn":{e.logger.warn({message:s,prefix:i+(a.plugin?":plugin:"+a.plugin:"")});return}case"debug":e.logger.debug({message:s,prefix:i+(a.plugin?":plugin:"+a.plugin:"")})}},"onLog"),onwarn(n,a){ci(n,e)||n.code||a(n)},watch:e.mode==="watch"?e.options.rollup.watch:!1}},"baseRollupOptions"),mi=T(async(e,t)=>{const i=tt(e,"build");let o;e.options.rollup.resolve&&(o=I(At({...e.options.rollup.resolve}),t));const n=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:is(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,p]=li(e.options.rollup.plugins,"build");return{...di(e,i,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:T(l=>X(l,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:$(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>xt(l,"cjs"),"entryFileNames"),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,...n},e.options.emitESM&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:T(l=>X(l,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:$(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>xt(l,"mjs"),"entryFileNames"),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,...n}].filter(Boolean),plugins:[I(Zt(),t),I(ri(),t),e.tsconfig&&I(si(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&I(ni(e.tsconfig,e.logger),t),e.options.rollup.replace&&Ft({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Tt({customResolver:o,...e.options.rollup.alias,entries:i}),...a,o,e.options.rollup.polyfillNode&&io({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&Vt({...e.options.rollup.json}),on(),e.options.rollup.wasm&&eo(e.options.rollup.wasm),e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&Kn(k(e.options.rootDir,e.options.sourceDir),e.options.isolatedDeclarationTransformer,e.options.declaration,!!e.options.rollup.cjsInterop,e.options.rollup.isolatedDeclarations),e.options.rollup.url&&Ga(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await En({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&&Pn(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&I(ka(e.options.rollup.raw),t),...s,e.options.transformer(ds(e.options.transformerName,e)),I(xa({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&Sa(e.options.entries.filter(l=>l.executable).map(l=>l.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Kt({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&Rn(),e.options.rollup.dynamicVars&&Zi(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&I(Qi({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&&Tn(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&I(na({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...p,e.options.rollup.metafile&&la(),e.options.rollup.copy&&mn(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Yt({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}),va(),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&ma(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&&oo({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"),ms=T(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"),us=Lo(ms),ui=T(async(e,t)=>{const i=tt(e,"types"),o=e.tsconfig?.config.compilerOptions;delete o?.lib;let n;e.options.rollup.resolve&&(n=I(At({...e.options.rollup.resolve}),t));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,p,l]=li(e.options.rollup.plugins,"dts");return{...di(e,i,"dts"),onwarn(r,c){ci(r,e)||r.code!=="EMPTY_BUNDLE"&&c(r)},output:[e.options.emitCJS&&{chunkFileNames:T(r=>X(r,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:$(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:T(r=>X(r,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:$(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:T(r=>X(r,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:$(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[I(Zt(),t),I(ri(),t),e.options.rollup.json&&Vt({...e.options.rollup.json}),{load(r){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(r)?null:""},name:"packem:ignore-files"},e.tsconfig&&I(si(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&I(ni(e.tsconfig,e.logger),t),e.options.rollup.replace&&Ft({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&Tt({customResolver:n,...e.options.rollup.alias,entries:i}),...s,n,...p,await us(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Kt({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&I(za(e.options.rollup.patchTypes,e.logger),t),Oa(),...l,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Yt({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 fs=Object.defineProperty,gs=f((e,t)=>fs(e,"name",{value:t,configurable:!0}),"m$5");const wt="rollup-build.json",vs=gs(async(e,t,i)=>{const o=await mi(e,t);if(await e.hooks.callHook("rollup:options",e,o),Object.keys(o.input).length===0)return;let n=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(n=!1),n&&(o.cache=t.get(wt,i));const a=await Mt(o);n&&t.set(wt,a.cache,i),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const p of o.output){const{output:l}=await a.write(p),r=new Set,c=l.filter(d=>d.type==="chunk");for(const d of c){r.add(d.fileName);for(const u of d.imports)e.usedImports.add(u);d.isEntry&&e.buildEntries.push({bytes:Buffer.byteLength(d.code,"utf8"),chunks:d.imports.filter(u=>c.find(v=>v.fileName===u)),exports:d.exports,modules:Object.entries(d.modules).map(([u,v])=>({bytes:v.renderedLength,id:u})),path:d.fileName,type:"entry"})}const m=l.filter(d=>d.type==="asset");for(const d of m)s.has(d.fileName)||s.set(d.fileName,{bytes:Buffer.byteLength(d.source,"utf8"),path:d.fileName,type:"asset"});for(const d of r)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var hs=Object.defineProperty,ye=f((e,t)=>hs(e,"name",{value:t,configurable:!0}),"a$8");const kt="rollup-dts.json",ys=ye(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 o=await ui(e,t);if(await e.hooks.callHook("rollup:dts:options",e,o),Object.keys(o.input).length===0)return;o.cache=t.get(kt,i);const n=await Mt(o);t.set(kt,n.cache,i),await e.hooks.callHook("rollup:dts:build",e,n),e.logger.info({message:"Building declaration files...",prefix:"dts"}),e.options.emitCJS&&await n.write({chunkFileNames:ye(a=>X(a,"d.cts"),"chunkFileNames"),dir:$(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await n.write({chunkFileNames:ye(a=>X(a,"d.mts"),"chunkFileNames"),dir:$(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await n.write({chunkFileNames:ye(a=>X(a,"d.mjs"),"chunkFileNames"),dir:$(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var xs=Object.defineProperty,bs=f((e,t)=>xs(e,"name",{value:t,configurable:!0}),"y$3");const ws=bs((e,t,i)=>e.reduce((o,n)=>{const a=n[t],s=n[i];return o[a]||(o[a]={}),o[a][s]||(o[a][s]=[]),o[a][s].push(n),o},{}),"groupByKeys");var ks=Object.defineProperty,Ee=f((e,t)=>ks(e,"name",{value:t,configurable:!0}),"j$1");const js=Ee((e,t)=>{const i=Ee(s=>_(t.options.rootDir,$(t.options.outDir,s)),"rPath");let o=!1;const n=[],a=t.buildEntries.filter(s=>s.type==="entry");if(a.length>0){e.raw(`Entries:
66
- `);for(const s of a){let p=s.bytes??0;for(const r of s.chunks??[])p+=t.buildEntries.find(c=>c.path===r)?.bytes??0;let l=` ${L(i(s.path))} (${["total size: "+D(K(p)),s.bytes&&"chunk size: "+D(K(s.bytes))].filter(Boolean).join(", ")})`;if(l+=s.exports?.length?`
67
- exports: `+V(s.exports.join(", ")):"",s.chunks?.length&&(l+=`
68
- ${s.chunks.map(r=>{const c=t.buildEntries.find(m=>m.path===r)??{};return V(" └─ "+i(r)+L(c.bytes?" ("+K(c?.bytes)+")":""))}).join(`
69
- `)}`),s.modules&&s.modules.length>0){const r=s.modules.filter(c=>c.id.includes("node_modules")).sort((c,m)=>(m.bytes||0)-(c.bytes||0)).map(c=>V(" 📦 "+i(c.id)+L(c.bytes?" ("+K(c.bytes)+")":""))).join(`
64
+ ↳ 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"),bt=new Map,We=new Map,co=T((e,t,o)=>{const i=oo(e.tsconfig,!1);return{external(n){n=oi(n,t);const a=Wt(n);if(qe(e.options.externals,a)||qe(e.options.externals,n))return!0;const{pkg:s}=e;if(n.startsWith(".")||Xe(n)||/src[/\\]/.test(n)||s.name&&n.startsWith(s.name))return!1;if(s.imports)for(const[p,l]of Object.entries(s.imports)){if(p===n)return!1;if(p.includes("*")){let r;We.has(p)?r=We.get(p):(r=Yo(w(e.options.rootDir,l.replace("/*","")),{withFileTypes:!0}).filter(c=>c.isFile()).map(c=>c.name),We.set(p,r));for(const c of r)if(c.replace(Q,"")===n.replace(Q,"").replace("#",""))return!1}}if(i){for(const{find:p}of i)if(p.test(n))return e.logger.debug({message:`Resolved alias ${n} to ${p.source}`,prefix:o}),!1}return bt.has(n)||e.logger.info({message:'Inlined implicit external "'+D(n)+'". If this is incorrect, add it to the "externals" option.',prefix:o}),bt.set(n,!0),!1},input:Object.fromEntries(e.options.entries.map(n=>[n.name,E(e.options.rootDir,n.input)])),logLevel:e.options.debug?"debug":"info",onLog:T((n,a)=>{let s=a.message;switch(a.stack&&(s=`${s}
65
+ ${a.stack}`),n){case"info":{e.logger.info({message:s,prefix:o+(a.plugin?":plugin:"+a.plugin:"")});return}case"warn":{e.logger.warn({message:s,prefix:o+(a.plugin?":plugin:"+a.plugin:"")});return}case"debug":e.logger.debug({message:s,prefix:o+(a.plugin?":plugin:"+a.plugin:"")})}},"onLog"),onwarn(n,a){lo(n,e)||n.code||a(n)},treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}},"baseRollupOptions"),mo=T(async(e,t)=>{const o=tt(e,"build");let i;e.options.rollup.resolve&&(i=I(Tt({...e.options.rollup.resolve}),t));const n=e.options.rollup.output?.preserveModules?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output.preserveModulesRoot??"src"}:{manualChunks:os(e.dependencyGraphMap,e.buildEntries),preserveModules:!1},[a,s,p]=po(e.options.rollup.plugins,"build");return{...co(e,o,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:T(l=>X(l,"cjs"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>xt(l,"cjs"),"entryFileNames"),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,...n},e.options.emitESM&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:T(l=>X(l,"mjs"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:T(l=>xt(l,"mjs"),"entryFileNames"),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,...n}].filter(Boolean),plugins:[I(Qt(),t),I(so(),t),e.tsconfig&&I(ao(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&I(io(e.tsconfig,e.logger),t),e.options.rollup.replace&&At({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&It({customResolver:i,...e.options.rollup.alias,entries:o}),...a,i,e.options.rollup.polyfillNode&&ii({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),e.options.rollup.json&&Kt({...e.options.rollup.json}),on(),e.options.rollup.wasm&&ti(e.options.rollup.wasm),e.options.declaration&&e.options.rollup.isolatedDeclarations&&e.options.isolatedDeclarationTransformer&&Kn(w(e.options.rootDir,e.options.sourceDir),e.options.isolatedDeclarationTransformer,e.options.declaration,!!e.options.rollup.cjsInterop,e.options.rollup.isolatedDeclarations),e.options.rollup.url&&Ga(e.options.rollup.url),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&await En({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,o),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&e.options.declaration&&Pn(e.options.rollup.css,e.options.rootDir,e.logger),e.options.rollup.raw&&I(ka(e.options.rollup.raw),t),...s,e.options.transformer(ds(e.options.transformerName,e)),I(xa({directiveRegex:/^['|"](use (\w+))['|"]$/,...e.options.rollup.preserveDirectives,logger:e.logger}),t),e.options.rollup.shebang&&Sa(e.options.entries.filter(l=>l.executable).map(l=>l.name).filter(Boolean),e.options.rollup.shebang),e.options.cjsInterop&&e.options.emitCJS&&Ut({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.dynamicVars&&Rn(),e.options.rollup.dynamicVars&&ei(e.options.rollup.dynamicVars),e.options.rollup.commonjs&&I(Zo({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&&Tn(e.pkg,e.options.rollup.shim),e.options.rollup.jsxRemoveAttributes&&I(na({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:e.logger}),t),...p,e.options.rollup.metafile&&la(),e.options.rollup.copy&&mn(e.options.rollup.copy,e.logger),e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Xt({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}),va(),e.options.emitCJS&&e.mode==="build"&&e.options.declaration==="compatible"&&e.options.rollup.node10Compatibility&&ma(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&&ni({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"),ms=T(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"),us=Li(ms),uo=T(async(e,t)=>{const o=tt(e,"types"),i=e.tsconfig?.config.compilerOptions;delete i?.lib;let n;e.options.rollup.resolve&&(n=I(Tt({...e.options.rollup.resolve}),t));const a="dts-plugin:"+process.pid+e.tsconfig.path,[s,p,l]=po(e.options.rollup.plugins,"dts");return{...co(e,o,"dts"),onwarn(r,c){lo(r,e)||r.code!=="EMPTY_BUNDLE"&&c(r)},output:[e.options.emitCJS&&{chunkFileNames:T(r=>X(r,"d.cts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:T(r=>X(r,"d.mts"),"chunkFileNames"),compact:e.options.minify,dir:E(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:T(r=>X(r,"d.ts"),"chunkFileNames"),compact:e.options.minify,dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[I(Qt(),t),I(so(),t),e.options.rollup.json&&Kt({...e.options.rollup.json}),{load(r){return/\.(?:js|cjs|mjs|jsx|ts|tsx|ctsx|mtsx|mts|json)$/.test(r)?null:""},name:"packem:ignore-files"},e.tsconfig&&I(ao(e.options.rootDir,e.logger,e.tsconfig),t),e.tsconfig&&I(io(e.tsconfig,e.logger),t),e.options.rollup.replace&&At({sourcemap:e.options.sourcemap,...e.options.rollup.replace}),e.options.rollup.alias&&It({customResolver:n,...e.options.rollup.alias,entries:o}),...s,n,...p,await us(a)(e),e.options.cjsInterop&&e.options.emitCJS&&Ut({...e.options.rollup.cjsInterop,logger:e.logger,type:e.pkg.type??"commonjs"}),e.options.rollup.patchTypes&&I(za(e.options.rollup.patchTypes,e.logger),t),Oa(),...l,e.options.rollup.license&&e.options.rollup.license.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Xt({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 fs=Object.defineProperty,gs=f((e,t)=>fs(e,"name",{value:t,configurable:!0}),"m$5");const wt="rollup-build.json",vs=gs(async(e,t,o)=>{const i=await mo(e,t);if(await e.hooks.callHook("rollup:options",e,i),Object.keys(i.input).length===0)return;let n=!0;(e.options.rollup.isolatedDeclarations||e.options.isolatedDeclarationTransformer||e.options.rollup.css)&&(n=!1),n&&(i.cache=t.get(wt,o));const a=await Mt(i);n&&t.set(wt,a.cache,o),await e.hooks.callHook("rollup:build",e,a);const s=new Map;for(const p of i.output){const{output:l}=await a.write(p),r=new Set,c=l.filter(d=>d.type==="chunk");for(const d of c){r.add(d.fileName);for(const u of d.imports)e.usedImports.add(u);d.isEntry&&e.buildEntries.push({bytes:Buffer.byteLength(d.code,"utf8"),chunks:d.imports.filter(u=>c.find(h=>h.fileName===u)),exports:d.exports,modules:Object.entries(d.modules).map(([u,h])=>({bytes:h.renderedLength,id:u})),path:d.fileName,type:"entry"})}const m=l.filter(d=>d.type==="asset");for(const d of m)s.has(d.fileName)||s.set(d.fileName,{bytes:Buffer.byteLength(d.source,"utf8"),path:d.fileName,type:"asset"});for(const d of r)e.usedImports.delete(d)}e.buildEntries.push(...s.values())},"build");var hs=Object.defineProperty,ye=f((e,t)=>hs(e,"name",{value:t,configurable:!0}),"a$8");const kt="rollup-dts.json",ys=ye(async(e,t,o)=>{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 i=await uo(e,t);if(await e.hooks.callHook("rollup:dts:options",e,i),Object.keys(i.input).length===0)return;i.cache=t.get(kt,o);const n=await Mt(i);t.set(kt,n.cache,o),await e.hooks.callHook("rollup:dts:build",e,n),e.logger.info({message:"Building declaration files...",prefix:"dts"}),e.options.emitCJS&&await n.write({chunkFileNames:ye(a=>X(a,"d.cts"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.cts"}),e.options.emitESM&&await n.write({chunkFileNames:ye(a=>X(a,"d.mts"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.mts"}),e.options.declaration==="compatible"&&await n.write({chunkFileNames:ye(a=>X(a,"d.mjs"),"chunkFileNames"),dir:E(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts"}),await e.hooks.callHook("rollup:dts:done",e)},"buildTypes");var xs=Object.defineProperty,bs=f((e,t)=>xs(e,"name",{value:t,configurable:!0}),"y$4");const ws=bs((e,t,o)=>e.reduce((i,n)=>{const a=n[t],s=n[o];return i[a]||(i[a]={}),i[a][s]||(i[a][s]=[]),i[a][s].push(n),i},{}),"groupByKeys");var ks=Object.defineProperty,Ee=f((e,t)=>ks(e,"name",{value:t,configurable:!0}),"j$1");const js=Ee((e,t)=>{const o=Ee(s=>_(t.options.rootDir,E(t.options.outDir,s)),"rPath");let i=!1;const n=[],a=t.buildEntries.filter(s=>s.type==="entry");if(a.length>0){e.raw(`Entries:
66
+ `);for(const s of a){let p=s.bytes??0;for(const r of s.chunks??[])p+=t.buildEntries.find(c=>c.path===r)?.bytes??0;let l=` ${L(o(s.path))} (${["total size: "+D(V(p)),s.bytes&&"chunk size: "+D(V(s.bytes))].filter(Boolean).join(", ")})`;if(l+=s.exports?.length?`
67
+ exports: `+H(s.exports.join(", ")):"",s.chunks?.length&&(l+=`
68
+ ${s.chunks.map(r=>{const c=t.buildEntries.find(m=>m.path===r)??{};return H(" └─ "+o(r)+L(c.bytes?" ("+V(c?.bytes)+")":""))}).join(`
69
+ `)}`),s.modules&&s.modules.length>0){const r=s.modules.filter(c=>c.id.includes("node_modules")).sort((c,m)=>(m.bytes||0)-(c.bytes||0)).map(c=>H(" 📦 "+o(c.id)+L(c.bytes?" ("+V(c.bytes)+")":""))).join(`
70
70
  `);l+=r.length>0?`
71
71
  inlined modules:
72
72
  `+r:""}if(t.options.declaration){let r=s.path.replace(/\.js$/,".d.ts"),c="commonjs";s.path.endsWith(".cjs")?r=s.path.replace(/\.cjs$/,".d.cts"):s.path.endsWith(".mjs")&&(c="module",r=s.path.replace(/\.mjs$/,".d.mts"));const m=t.buildEntries.find(d=>d.path.endsWith(r));if(m){n.push(m.path);let d;r.includes(".d.ts")||(r=r.replace(".d.c",".d."),d=t.buildEntries.find(u=>u.path.endsWith(r))),d&&(n.push(d.path),l+=c==="commonjs"?`
73
73
  types:
74
- `+[m,d].map(u=>V(" └─ ")+L(i(u.path))+" (total size: "+D(K(u.bytes??0))+")").join(`
74
+ `+[m,d].map(u=>H(" └─ ")+L(o(u.path))+" (total size: "+D(V(u.bytes??0))+")").join(`
75
75
  `):`
76
- types: `+L(i(m.path))+" (total size: "+D(K(m.bytes??0))+")")}}o=!0,l+=`
76
+ types: `+L(o(m.path))+" (total size: "+D(V(m.bytes??0))+")")}}i=!0,l+=`
77
77
 
78
- `,e.raw(s.chunk?V(l):l)}}if(t.buildEntries.filter(s=>s.type==="asset").length>0){let s="Assets:";for(const p of t.buildEntries.filter(l=>l.type==="asset"))n.includes(p.path)||(s+=V(`
79
- └─ `)+L(i(p.path))+" (total size: "+D(K(p.bytes??0))+")");s+=`
78
+ `,e.raw(s.chunk?H(l):l)}}if(t.buildEntries.filter(s=>s.type==="asset").length>0){let s="Assets:";for(const p of t.buildEntries.filter(l=>l.type==="asset"))n.includes(p.path)||(s+=H(`
79
+ └─ `)+L(o(p.path))+" (total size: "+D(V(p.bytes??0))+")");s+=`
80
80
 
81
- `,e.raw(s)}return o&&e.raw("Σ Total dist size (byte size):",D(K(t.buildEntries.reduce((s,p)=>s+(p.bytes??0),0),{decimals:2})),`
82
- `),o},"showSizeInformation"),$s=Ee((e,t)=>{const i=ws(e.options.entries,"environment","runtime"),o=new Set,n=new Set;for(const[a,s]of Object.entries(i))for(const[p,l]of Object.entries(s)){const r={...e};!e.options.dtsOnly&&(a!=="undefined"||p!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":D(a)+" environment"+(p==="undefined"?"":" with "))+(p==="undefined"?"":D(p)+" runtime"));const c={};r.options.rollup.replace?(r.options.rollup.replace.values===void 0&&(r.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(p==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let m="";a!=="undefined"&&(m+=a+"/"),p!=="undefined"&&(m+=p+"/");let d=!1;r.options.minify!==void 0&&(d=r.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],v=[],x=[],y=[];for(const g of l)g.cjs&&g.esm?u.push(g):g.cjs?x.push(g):g.esm?v.push(g):g.declaration&&y.push(g);if(u.length>0){const g={...r,options:{...r.options,emitCJS:!0,emitESM:!0,entries:u,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:g,fileCache:t,subDirectory:m}),e.options.declaration){const b=g.options.entries.filter(w=>w.declaration);b.length>0&&n.add({context:{...g,options:{...g.options,entries:b}},fileCache:t,subDirectory:m})}}if(v.length>0){const g={...r,options:{...r.options,emitCJS:!1,emitESM:!0,entries:v,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:g,fileCache:t,subDirectory:m}),e.options.declaration){const b=g.options.entries.filter(w=>w.declaration);b.length>0&&n.add({context:{...g,options:{...g.options,entries:b}},fileCache:t,subDirectory:m})}}if(x.length>0){const g={...r,options:{...r.options,emitCJS:!0,emitESM:!1,entries:x,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||o.add({context:g,fileCache:t,subDirectory:m}),e.options.declaration){const b=g.options.entries.filter(w=>w.declaration);b.length>0&&n.add({context:{...g,options:{...g.options,entries:b}},fileCache:t,subDirectory:m})}}r.options.declaration&&y.length>0&&n.add({context:{...r,options:{...r.options,emitCJS:!1,emitESM:!1,entries:y,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:m})}return{builders:o,typeBuilders:n}},"prepareRollupConfig"),Es=Ee(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:o}=$s(e,t);await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await vs(n,a,s))),await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await ys(n,a,s))),e.logger.success(Si(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of Mi(k(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>k(e.options.rootDir,e.options.outDir,s.path)===n.path);if(a||(a={chunk:!0,path:n.path},e.buildEntries.push(a)),!a.bytes){const s=await Xe($(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),js(e.logger,e)},"build");var Ss=Object.defineProperty,Os=f((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"r$4");const S=Os((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Ds=Object.defineProperty,fi=f((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"t$4");const Se=fi(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),Ke=fi((e,t,i,o)=>{if(e==="module-sync")return"esm";if(o){const s=Se(o);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return i;const[n,...a]=t;return Ke(n,a,i,o)},"inferExportType");var Ps=Object.defineProperty,Ns=f((e,t)=>Ps(e,"name",{value:t,configurable:!0}),"y$2");const Cs=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...Jt,...ke]),it=Ns((e,t,i,o=[])=>{if(!e)return[];if(typeof e=="string"){const n=Se(e);if(n&&n!==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:n??t}]}if(typeof e=="object"){const n=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,p]of n)if(typeof p=="string"){let l={};Number.isInteger(+s)?l={exportKey:"*"}:s.startsWith("./")?l={exportKey:s.replace("./","")}:l={exportKey:s==="."?".":"*",subKey:s},a.push({...l,file:p,key:"exports",type:Ke(s,o,t,p)})}else if(typeof p=="object"&&p!==null)for(const[l,r]of Object.entries(p)){if(i===!1&&l==="types")continue;const c=Number.isInteger(+s)?l:s;typeof r=="string"?a.push({exportKey:c.replace("./",""),file:r,key:"exports",...Cs.has(l)?{subKey:l}:{},type:Ke(l,o,t,r)}):a=[...a,...it({[c]:r},t,i,[...o,l])]}return a}return[]},"extractExportFilenames");var _s=Object.defineProperty,Ce=f((e,t)=>_s(e,"name",{value:t,configurable:!0}),"c$6");const Ms=Ce((e,t)=>e.key==="exports"&&e.subKey===me?me:e.key==="exports"&&e.subKey===pt?pt:t,"getEnvironment"),xe=Ce((e,t,i,o,n,a,s)=>{const p=Ms(n,a.environment);let l="node";for(const m of Jt)if(n.file.includes("."+m+".")||n.subKey===m){l=m;break}let r=e.find(m=>m.input===t&&m.environment===p&&m.runtime===l);r===void 0?r=e[e.push({environment:p,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:l})-1]:r.exportKey&&n.exportKey&&r.exportKey.add(n.exportKey),s&&(r.isGlob=!0),i&&(r.outDir=o),n.isExecutable?(r.executable=!0,r.declaration=!1,n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0)):(/\.d\.[mc]?ts$/.test(n.file)&&a.options.declaration!==!1&&(r.declaration=a.options.declaration),n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0));const c=n.file.replace(Ge(n.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");ke.has(n.subKey)&&!t.includes(c)&&(r.fileAlias=c)},"createOrUpdateEntry");let jt=!1;const $t=Ce(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"),Is=Ce((e,t,i)=>{const o=[];t.sort((p,l)=>p.split("/").length-l.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(i.options.emitESM=!0),n==="cjs"&&(i.options.emitCJS=!0);const a=it(e.exports,n,i.options.declaration);if(e.bin){const p=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const l of p){const r=Se(l);if(r&&r!==n)throw new Error(`Exported file "${l}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:l,isExecutable:!0,key:"bin",type:r??n})}}e.main&&a.push({file:e.main,key:"main",type:Se(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&($t(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const p of a){i.options.declaration===void 0&&(p.key==="types"||p.subKey==="types")&&(i.options.declaration=p.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&p.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&p.type==="esm"&&(i.options.emitESM=!0);const l=p.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),r=l.endsWith("/");if(r&&["./","/"].includes(l))continue;const c=l.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),m="(?<=/|$)",d=r?"":"\\.\\w+$";if(p.file.includes("/*")&&p.key==="exports"){jt||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),jt=!0);const y=[],g=new RegExp(m+c.replace("*","(.*)")+d),b=new RegExp(m+c.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+d);for(const w of t)(g.test(w)||ke.has(p.subKey)&&b.test(w))&&y.push(w);if(y.length===0){o.push(`Could not find entrypoint for \`${p.file}\``);continue}for(const w of y)xe(s,w,r,l,p,i,!0);continue}const u=new RegExp(m+c+d);let v=t.find(y=>u.test(y));if(ke.has(p.subKey)&&v===void 0){const y=new RegExp(m+c.replace(/(.*)\.[^.]*$/,"$1")+d);v=t.find(g=>y.test(g))}if(v===void 0){G($(i.options.rootDir,p.file))||o.push(`Could not find entrypoint for \`${p.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&G(v)&&$t(i);const x=we(v.replace(Q,""));G(x+".cts")&&G(x+".mts")?(xe(s,x+".cts",r,l,{...p,type:"cjs"},i,!1),xe(s,x+".mts",r,l,{...p,type:"esm"},i,!1)):xe(s,v,r,l,p,i,!1)}return{entries:s,warnings:o}},"inferEntries");var Ts=Object.defineProperty,As=f((e,t)=>Ts(e,"name",{value:t,configurable:!0}),"o$3");const Fs=As((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 Rs=Object.defineProperty,zs=f((e,t)=>Rs(e,"name",{value:t,configurable:!0}),"t$3");const Js={hooks:{"build:prepare":zs(function(e){if(e.options.entries.length>0)return;const t=k(e.options.rootDir,e.options.sourceDir);if(!It(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=Ii(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 o={...e.pkg};o.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(o.publishConfig).join(", ")+'".'),e.logger.debug(o.publishConfig),o=Fs(o,e.options.declaration));const n=Is(o,i,e);for(const a of n.warnings)S(e,a);if(e.options.entries.push(...n.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?L(a.fileAlias)+" => "+L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),V([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Ws=Object.defineProperty,Bs=f((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"t$2");const Ls=Bs(async(e,t)=>{if(e==="auto")e=Js;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var qs=Object.defineProperty,Us=f((e,t)=>qs(e,"name",{value:t,configurable:!0}),"j");const Ks=Us(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],o=JSON.stringify({...e.options.jiti,alias:{...tt(e,"jit"),...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((n,a)=>{if(Array.isArray(n)){const[s,...p]=n;return i.push(s),"["+["plugin"+a,...p.map(l=>JSON.stringify(l))].join(", ")+"]"}return i.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=$(e.options.rootDir,e.options.outDir,n.name),s=wo(e.jiti.esmResolve(n.input,{try:!0})??n.input),p=s.replace(Q,""),l=Ve(s),r=Da(l);let c=[];try{c=await ko(s,{extensions:Ye})}catch(d){S(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=_(A(a),await mt("jiti",{conditions:["node","import"],url:import.meta.url})),u=p+".d.mts";ne(`${a}.mjs`,r+['import { createJiti } from "'+d+'";',...i.map((v,x)=>"import plugin"+x+' from "'+v+'";'),"","const jiti = createJiti(import.meta.url, "+o+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
83
- export default _module;`:"",...c.filter(v=>v!=="default").map(v=>`export const ${v} = _module.${v};`)].join(`
81
+ `,e.raw(s)}return i&&e.raw("Σ Total dist size (byte size):",D(V(t.buildEntries.reduce((s,p)=>s+(p.bytes??0),0),{decimals:2})),`
82
+ `),i},"showSizeInformation"),$s=Ee((e,t)=>{const o=ws(e.options.entries,"environment","runtime"),i=new Set,n=new Set;for(const[a,s]of Object.entries(o))for(const[p,l]of Object.entries(s)){const r={...e};!e.options.dtsOnly&&(a!=="undefined"||p!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":D(a)+" environment"+(p==="undefined"?"":" with "))+(p==="undefined"?"":D(p)+" runtime"));const c={};r.options.rollup.replace?(r.options.rollup.replace.values===void 0&&(r.options.rollup.replace.values={}),a!=="undefined"&&(c[["process","env","NODE_ENV"].join(".")]=JSON.stringify(a)),c[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(p==="edge-light"),Object.freeze(c)):e.logger.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");let m="";a!=="undefined"&&(m+=a+"/"),p!=="undefined"&&(m+=p+"/");let d=!1;r.options.minify!==void 0&&(d=r.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],h=[],v=[],b=[];for(const g of l)g.cjs&&g.esm?u.push(g):g.cjs?v.push(g):g.esm?h.push(g):g.declaration&&b.push(g);if(u.length>0){const g={...r,options:{...r.options,emitCJS:!0,emitESM:!0,entries:u,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||i.add({context:g,fileCache:t,subDirectory:m}),e.options.declaration){const x=g.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...g,options:{...g.options,entries:x}},fileCache:t,subDirectory:m})}}if(h.length>0){const g={...r,options:{...r.options,emitCJS:!1,emitESM:!0,entries:h,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||i.add({context:g,fileCache:t,subDirectory:m}),e.options.declaration){const x=g.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...g,options:{...g.options,entries:x}},fileCache:t,subDirectory:m})}}if(v.length>0){const g={...r,options:{...r.options,emitCJS:!0,emitESM:!1,entries:v,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}};if(e.options.dtsOnly||i.add({context:g,fileCache:t,subDirectory:m}),e.options.declaration){const x=g.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...g,options:{...g.options,entries:x}},fileCache:t,subDirectory:m})}}r.options.declaration&&b.length>0&&n.add({context:{...r,options:{...r.options,emitCJS:!1,emitESM:!1,entries:b,minify:d,rollup:{...r.options.rollup,replace:r.options.rollup.replace?{...r.options.rollup.replace,values:{...r.options.rollup.replace.values,...c}}:!1}}},fileCache:t,subDirectory:m})}return{builders:i,typeBuilders:n}},"prepareRollupConfig"),Es=Ee(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:o,typeBuilders:i}=$s(e,t);await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await vs(n,a,s))),await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await ys(n,a,s))),e.logger.success(So(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of Mo(w(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>w(e.options.rootDir,e.options.outDir,s.path)===n.path);if(a||(a={chunk:!0,path:n.path},e.buildEntries.push(a)),!a.bytes){const s=await Ye(E(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),js(e.logger,e)},"build");var Ss=Object.defineProperty,Os=f((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"r$4");const O=Os((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Ds=Object.defineProperty,fo=f((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"t$4");const Se=fo(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),He=fo((e,t,o,i)=>{if(e==="module-sync")return"esm";if(i){const s=Se(i);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return o;const[n,...a]=t;return He(n,a,o,i)},"inferExportType");var Ps=Object.defineProperty,Ns=f((e,t)=>Ps(e,"name",{value:t,configurable:!0}),"y$3");const Cs=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...zt,...ke]),ot=Ns((e,t,o,i=[])=>{if(!e)return[];if(typeof e=="string"){const n=Se(e);if(n&&n!==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:n??t}]}if(typeof e=="object"){const n=Object.entries(e).filter(([s])=>!s.endsWith(".json"));let a=[];for(const[s,p]of n)if(typeof p=="string"){let l={};Number.isInteger(+s)?l={exportKey:"*"}:s.startsWith("./")?l={exportKey:s.replace("./","")}:l={exportKey:s==="."?".":"*",subKey:s},a.push({...l,file:p,key:"exports",type:He(s,i,t,p)})}else if(typeof p=="object"&&p!==null)for(const[l,r]of Object.entries(p)){if(o===!1&&l==="types")continue;const c=Number.isInteger(+s)?l:s;typeof r=="string"?a.push({exportKey:c.replace("./",""),file:r,key:"exports",...Cs.has(l)?{subKey:l}:{},type:He(l,i,t,r)}):a=[...a,...ot({[c]:r},t,o,[...i,l])]}return a}return[]},"extractExportFilenames");var _s=Object.defineProperty,Me=f((e,t)=>_s(e,"name",{value:t,configurable:!0}),"y$2");const Ms=Me((e,t)=>e.key==="exports"&&e.subKey===me?me:e.key==="exports"&&e.subKey===pt?pt:t,"getEnvironment"),xe=Me((e,t,o,i,n,a,s)=>{const p=Ms(n,a.environment);let l="node";for(const m of zt)if(n.file.includes("."+m+".")||n.subKey===m){l=m;break}let r=e.find(m=>m.input===t&&m.environment===p&&m.runtime===l);r===void 0?r=e[e.push({environment:p,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:l})-1]:r.exportKey&&n.exportKey&&r.exportKey.add(n.exportKey),s&&(r.isGlob=!0),o&&(r.outDir=i),n.isExecutable?(r.executable=!0,r.declaration=!1,n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0)):(/\.d\.[mc]?ts$/.test(n.file)&&a.options.declaration!==!1&&(r.declaration=a.options.declaration),n.type==="cjs"?r.cjs=!0:n.type==="esm"&&(r.esm=!0));const c=n.file.replace(Pe(n.file),"").replace(new RegExp(`^./${a.options.outDir.replace(/^\.\//,"")}/`),"");ke.has(n.subKey)&&!t.includes(c)&&(r.fileAlias=c)},"createOrUpdateEntry");let jt=!1;const $t=Me(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"),Is=Me((e,t,o)=>{const i=[];t.sort((p,l)=>p.split("/").length-l.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(o.options.emitESM=!0),n==="cjs"&&(o.options.emitCJS=!0);const a=ot(e.exports,n,o.options.declaration);if(e.bin){const p=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const l of p){const r=Se(l);if(r&&r!==n)throw new Error(`Exported file "${l}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:l,isExecutable:!0,key:"bin",type:r??n})}}e.main&&a.push({file:e.main,key:"main",type:Se(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&($t(o),o.options.declaration===void 0&&(o.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const p of a){const l=Pe(p.file);if(l!==""&&!Ne.includes(l))continue;o.options.declaration===void 0&&(p.key==="types"||p.subKey==="types")&&(o.options.declaration=p.file.includes(".d.ts")?"compatible":!0),o.options.emitCJS===void 0&&p.type==="cjs"&&(o.options.emitCJS=!0),o.options.emitESM===void 0&&p.type==="esm"&&(o.options.emitESM=!0);const r=p.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=r.endsWith("/");if(c&&["./","/"].includes(r))continue;const m=r.replace(new RegExp("(./)?"+o.options.outDir),o.options.sourceDir).replace("./",""),d="(?<=/|$)",u=c?"":"(\\.[cm]?[tj]sx?)$";if(p.file.includes("/*")&&p.key==="exports"){jt||(o.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),jt=!0);const g=[],x=new RegExp(d+m.replace("*","(.*)")+u),k=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+u);for(const $ of t)(x.test($)||ke.has(p.subKey)&&k.test($))&&g.push($);if(g.length===0){i.push(`Could not find entrypoint for \`${p.file}\``);continue}for(const $ of g)xe(s,$,c,r,p,o,!0);continue}const h=new RegExp(d+m+u);let v=t.find(g=>h.test(g));if(ke.has(p.subKey)&&v===void 0){const g=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1")+u);v=t.find(x=>g.test(x))}if(v===void 0){U(E(o.options.rootDir,p.file))||i.push(`Could not find entrypoint for \`${p.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&U(v)&&$t(o);const b=we(v.replace(Q,""));U(b+".cts")&&U(b+".mts")?(xe(s,b+".cts",c,r,{...p,type:"cjs"},o,!1),xe(s,b+".mts",c,r,{...p,type:"esm"},o,!1)):xe(s,v,c,r,p,o,!1)}return{entries:s,warnings:i}},"inferEntries");var Ts=Object.defineProperty,As=f((e,t)=>Ts(e,"name",{value:t,configurable:!0}),"o$3");const Fs=As((e,t)=>{const{publishConfig:o}=e;return o&&(o.bin&&(typeof o.bin=="object"||typeof o.bin=="string")&&(e.bin=o.bin),o.type&&typeof o.type=="string"&&o.type!==""&&(e.type=o.type),o.main&&typeof o.main=="string"&&o.main!==""&&(e.main=o.main),o.module&&typeof o.module=="string"&&o.module!==""&&(e.module=o.module),t===void 0&&o.types&&typeof o.types=="string"&&o.types!==""?e.types=o.types:t===void 0&&o.typings&&typeof o.typings=="string"&&o.typings!==""&&(e.typings=o.typings),o.exports&&typeof o.exports=="object"&&(e.exports=o.exports)),e},"overwriteWithPublishConfig");var Rs=Object.defineProperty,zs=f((e,t)=>Rs(e,"name",{value:t,configurable:!0}),"t$3");const Js={hooks:{"build:prepare":zs(function(e){if(e.options.entries.length>0)return;const t=w(e.options.rootDir,e.options.sourceDir);if(!U(t))throw new Error("No 'src' directory found. Please provide entries manually.");const o=Io(t,{extensions:[],includeDirs:!1,includeSymlinks:!1});if(o.length===0)throw new Error("No source files found in 'src' directory. Please provide entries manually.");let i={...e.pkg};i.publishConfig&&(e.logger.info('Using publishConfig found in package.json, to override the default key-value pairs of "'+Object.keys(i.publishConfig).join(", ")+'".'),e.logger.debug(i.publishConfig),i=Fs(i,e.options.declaration));const n=Is(i,o,e);for(const a of n.warnings)O(e,a);if(e.options.entries.push(...n.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?L(a.fileAlias)+" => "+L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):L(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),H([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Ws=Object.defineProperty,Bs=f((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"t$2");const Ls=Bs(async(e,t)=>{if(e==="auto")e=Js;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var qs=Object.defineProperty,Us=f((e,t)=>qs(e,"name",{value:t,configurable:!0}),"j");const Ks=Us(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,o=[],i=JSON.stringify({...e.options.jiti,alias:{...tt(e,"jit"),...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((n,a)=>{if(Array.isArray(n)){const[s,...p]=n;return o.push(s),"["+["plugin"+a,...p.map(l=>JSON.stringify(l))].join(", ")+"]"}return o.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=E(e.options.rootDir,e.options.outDir,n.name),s=wi(e.jiti.esmResolve(n.input,{try:!0})??n.input),p=s.replace(Q,""),l=Ge(s),r=Da(l);let c=[];try{c=await ki(s,{extensions:Ne})}catch(d){O(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=_(A(a),await mt("jiti",{conditions:["node","import"],url:import.meta.url})),u=p+".d.mts";ne(`${a}.mjs`,r+['import { createJiti } from "'+d+'";',...o.map((h,v)=>"import plugin"+v+' from "'+h+'";'),"","const jiti = createJiti(import.meta.url, "+i+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
83
+ export default _module;`:"",...c.filter(h=>h!=="default").map(h=>`export const ${h} = _module.${h};`)].join(`
84
84
  `)),e.options.declaration&&ne(`${a}.d.mts`,'export * from "'+u+`";
85
- `+(m?'export { default } from "'+u+'";':""))}if(e.options.emitCJS){const d=_(A(a),await mt("jiti",{conditions:["node","require"],url:import.meta.url})),u=p+".d.cts";ne(`${a}.cjs`,r+['const { createJiti } = require("'+d+'");',...i.map((v,x)=>"const plugin"+x+" = require("+JSON.stringify(v)+")"),"","const jiti = createJiti(__filename, "+o+");","",'/** @type {import("'+u+'")} */','module.exports = jiti("'+s+'")'].join(`
85
+ `+(m?'export { default } from "'+u+'";':""))}if(e.options.emitCJS){const d=_(A(a),await mt("jiti",{conditions:["node","require"],url:import.meta.url})),u=p+".d.cts";ne(`${a}.cjs`,r+['const { createJiti } = require("'+d+'");',...o.map((h,v)=>"const plugin"+v+" = require("+JSON.stringify(h)+")"),"","const jiti = createJiti(__filename, "+i+");","",'/** @type {import("'+u+'")} */','module.exports = jiti("'+s+'")'].join(`
86
86
  `)),e.options.declaration&&ne(a+".d.cts",'export * from "'+u+`";
87
- `+(m?'export { default } from "'+u+'";':""))}r&&(await Ue(`${a}.cjs`),await Ue(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var Vs=Object.defineProperty,ot=f((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"i$2");const Hs=ot(e=>{const{message:t,name:i="Error",stack:o}=e;if(!o)return o;const n=`${i}: ${t}
88
- `;return o.startsWith(n)?o.slice(n.length):o},"extractStack"),Gs=ot(e=>`
87
+ `+(m?'export { default } from "'+u+'";':""))}r&&(await Ve(`${a}.cjs`),await Ve(`${a}.mjs`))}await e.hooks.callHook("rollup:done",e)},"createStub");var Vs=Object.defineProperty,it=f((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"i$2");const Hs=it(e=>{const{message:t,name:o="Error",stack:i}=e;if(!i)return i;const n=`${o}: ${t}
88
+ `;return i.startsWith(n)?i.slice(n.length):i},"extractStack"),Gs=it(e=>`
89
89
  ${e.replaceAll(/^\n|\n$/g,"")}
90
- `,"normalizeCodeFrame"),gi=ot(e=>{const t=Hs(e);let i=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(i+=`
91
- file: ${D(e.id+(e.loc?":"+e.loc.line+":"+e.loc.column:""))}`),e.frame&&(i+=`
92
- `+Oi(Gs(e.frame))),e.message=i,t!==void 0&&(e.stack=`${e.message}
93
- ${t}`)},"enhanceRollupError");var Xs=Object.defineProperty,vi=f((e,t)=>Xs(e,"name",{value:t,configurable:!0}),"d$3");const Oe="rollup-watch.json",Et=vi(({context:e,doOnSuccessCleanup:t,fileCache:i,mode:o,runBuilder:n,runOnsuccess:a,useCache:s,watcher:p})=>{const l="watcher:"+o;p.on("change",async(r,{event:c})=>{await t?.(),e.logger.info({message:`${D(_(".",r))} was ${c}d`,prefix:l})}),p.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:l})}),p.on("event",async r=>{switch(r.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:l}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:D("build started..."),prefix:l});break}case"BUNDLE_END":{await r.result.close(),s&&i.set(o==="bundle"?Oe:"dts-"+Oe,r.result.cache),e.logger.raw(`
90
+ `,"normalizeCodeFrame"),go=it(e=>{const t=Hs(e);let o=(e.plugin?`[${e.plugin}] `:"")+e.message;e.id&&(o+=`
91
+ file: ${D(e.id+(e.loc?":"+e.loc.line+":"+e.loc.column:""))}`),e.frame&&(o+=`
92
+ `+Oo(Gs(e.frame))),e.message=o,t!==void 0&&(e.stack=`${e.message}
93
+ ${t}`)},"enhanceRollupError");var Xs=Object.defineProperty,vo=f((e,t)=>Xs(e,"name",{value:t,configurable:!0}),"d$3");const Oe="rollup-watch.json",Et=vo(({context:e,doOnSuccessCleanup:t,fileCache:o,mode:i,runBuilder:n,runOnsuccess:a,useCache:s,watcher:p})=>{const l="watcher:"+i;p.on("change",async(r,{event:c})=>{await t?.(),e.logger.info({message:`${D(_(".",r))} was ${c}d`,prefix:l})}),p.on("restart",()=>{e.logger.info({message:"Rebuilding ...",prefix:l})}),p.on("event",async r=>{switch(r.code){case"END":{e.logger.success({message:"Rebuild finished",prefix:l}),await a?.();break}case"BUNDLE_START":{e.logger.info({message:D("build started..."),prefix:l});break}case"BUNDLE_END":{await r.result.close(),s&&o.set(i==="bundle"?Oe:"dts-"+Oe,r.result.cache),e.logger.raw(`
94
94
  ⚡️ Build run in `+r.duration+`ms
95
95
 
96
- `),await n?.(!0);break}case"ERROR":{gi(r.error),e.logger.error({context:[r.error],message:"Rebuild failed: "+r.error.message,prefix:l});break}}})},"watchHandler"),Ys=vi(async(e,t,i,o,n)=>{const a=await mi(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(Oe)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[k(e.options.sourceDir,"**","*"),"package.json","packem.config.*"],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 p=rt(a);await e.hooks.callHook("rollup:watch",e,p);const l=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let r="Starting watcher for entries:";for(const c of l)r+=V(`
97
- └─ ${_(process.cwd(),c)}`);if(e.logger.info(r),Et({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:o,useCache:s,watcher:p}),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 ui(e,t);s&&(c.cache=t.get("dts-"+Oe)),await e.hooks.callHook("rollup:dts:options",e,c);const m=rt(c);await e.hooks.callHook("rollup:watch",e,m),Et({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Qs=Object.defineProperty,Zs=f((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"s$5");const er=Zs(async e=>{const t=[];if(e.options.clean)for(const i of new Set(e.options.entries.map(o=>o.outDir).filter(Boolean).sort()))i===e.options.rootDir||i===e.options.sourceDir||e.options.rootDir.startsWith(i.endsWith("/")?i:`${i}/`)||t.some(o=>i.startsWith(o))||(t.push(i),e.logger.info(`Cleaning dist directory: \`./${_(e.options.rootDir,i)}\``),await Ti(i))},"cleanDistributionDirectories");var tr=Object.defineProperty,hi=f((e,t)=>tr(e,"name",{value:t,configurable:!0}),"s$4");const ir=hi(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let or=class{static{f(this,"g")}static{hi(this,"FileCache")}#o;#e;#n;#t=!0;#i=new Map;constructor(t,i,o,n){this.#o=t,this.#n=o,i===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#e=i,n.debug({message:"Cache path is: "+this.#e,prefix:"file-cache"}))}set isEnabled(t){this.#t=t}has(t,i){return!this.#t||this.#e===void 0?!1:G(this.getFilePath(t,i))}get(t,i){if(!this.#t||this.#e===void 0)return;const o=this.getFilePath(t,i);if(this.#i.has(o))return this.#i.get(o);if(!G(o))return;const n=Ve(o);if(ir(n)){const a=JSON.parse(n);return this.#i.set(o,a),a}return this.#i.set(o,n),n}set(t,i,o){if(!this.#t||this.#e===void 0||i===void 0)return;const n=this.getFilePath(t,o);typeof i=="object"&&(i=JSON.stringify(i)),ne(n,i,{overwrite:!0})}getFilePath(t,i){let o=t.replaceAll(we(this.#o),"");return o=o.replaceAll(":","-"),k(this.#e,this.#n,i?.replaceAll(":","-")??"",we(o))}};var nr=Object.defineProperty,ar=f((e,t)=>nr(e,"name",{value:t,configurable:!0}),"t$1");const sr=ar(async(e,t="")=>{let i=t;if(!i){const o=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const n of o)if(await De(k(e,n))){i="./"+n;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");var rr=Object.defineProperty,be=f((e,t)=>rr(e,"name",{value:t,configurable:!0}),"l$4");const pr=ee,lr=be((e,t)=>{const{sideEffects:i}=t;let o;if(typeof i=="boolean")o=be(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)o=be(()=>!1,"hasSideEffects");else{const n=i.map(a=>a.includes("/")?a:`**/${a}`);o=pr(n,null,{resolve:e})}else o=be(()=>null,"hasSideEffects");return o},"getPackageSideEffect");var Je,St;function cr(){if(St)return Je;St=1;var e=Object.defineProperty,t=f((l,r)=>e(l,"name",{value:r,configurable:!0}),"s"),i=Co,o=i.spawn,n=i.exec;Je=f(function(l,r,c){if(typeof r=="function"&&c===void 0&&(c=r,r=void 0),l=parseInt(l),Number.isNaN(l)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var m={},d={};switch(m[l]=[],d[l]=1,process.platform){case"win32":n("taskkill /pid "+l+" /T /F",c);break;case"darwin":p(l,m,d,function(u){return o("pgrep",["-P",u])},function(){a(m,r,c)});break;default:p(l,m,d,function(u){return o("ps",["-o","pid","--no-headers","--ppid",u])},function(){a(m,r,c)});break}},"treeKill");function a(l,r,c){var m={};try{Object.keys(l).forEach(function(d){l[d].forEach(function(u){m[u]||(s(u,r),m[u]=1)}),m[d]||(s(d,r),m[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}f(a,"killAll"),t(a,"killAll");function s(l,r){try{process.kill(parseInt(l,10),r)}catch(c){if(c.code!=="ESRCH")throw c}}f(s,"killPid"),t(s,"killPid");function p(l,r,c,m,d){var u=m(l),v="";u.stdout.on("data",function(g){var g=g.toString("ascii");v+=g});var x=t(function(y){if(delete c[l],y!=0){Object.keys(c).length==0&&d();return}v.match(/\d+/g).forEach(function(g){g=parseInt(g,10),r[l].push(g),r[g]=[],c[g]=1,p(g,r,c,m,d)})},"onClose");u.on("close",x)}return f(p,"buildProcessTree"),t(p,"buildProcessTree"),Je}f(cr,"requireTreeKill");var dr=cr();const mr=fo(dr);var ur=Object.defineProperty,yi=f((e,t)=>ur(e,"name",{value:t,configurable:!0}),"l$3");const fr=yi(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),gr=yi(async({pid:e,signal:t})=>await new Promise((i,o)=>{if(!Number.isInteger(e)||e<=0){o(new Error("Invalid process ID"));return}mr(e,t,n=>{if(n&&!fr(n)){o(n);return}i()})}),"killProcess");var vr=Object.defineProperty,hr=f((e,t)=>vr(e,"name",{value:t,configurable:!0}),"n");const xi=hr(e=>{const t=k(e,"package.json");if(!G(t))throw new Error("package.json not found at "+t);return{packageJson:_o(t),packageJsonPath:t}},"loadPackageJson");var yr=Object.defineProperty,xr=f((e,t)=>yr(e,"name",{value:t,configurable:!0}),"r$2");const Ot=xr((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
96
+ `),await n?.(!0);break}case"ERROR":{go(r.error),e.logger.error({context:[r.error],message:"Rebuild failed: "+r.error.message,prefix:l});break}}})},"watchHandler"),Ys=vo(async(e,t,o,i,n)=>{const a=await mo(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(Oe)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[w(e.options.sourceDir,"**","*"),"package.json","packem.config.*"],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 p=rt(a);await e.hooks.callHook("rollup:watch",e,p);const l=[...Array.isArray(a.input)?a.input:typeof a.input=="string"?[a.input]:Object.keys(a.input??{})];let r="Starting watcher for entries:";for(const c of l)r+=H(`
97
+ └─ ${_(process.cwd(),c)}`);if(e.logger.info(r),Et({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:o,runOnsuccess:i,useCache:s,watcher:p}),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 uo(e,t);s&&(c.cache=t.get("dts-"+Oe)),await e.hooks.callHook("rollup:dts:options",e,c);const m=rt(c);await e.hooks.callHook("rollup:watch",e,m),Et({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Qs=Object.defineProperty,Zs=f((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"s$5");const er=Zs(async e=>{const t=[];if(e.options.clean)for(const o of new Set(e.options.entries.map(i=>i.outDir).filter(Boolean).sort()))o===e.options.rootDir||o===e.options.sourceDir||e.options.rootDir.startsWith(o.endsWith("/")?o:`${o}/`)||t.some(i=>o.startsWith(i))||(t.push(o),e.logger.info(`Cleaning dist directory: \`./${_(e.options.rootDir,o)}\``),await To(o))},"cleanDistributionDirectories");var tr=Object.defineProperty,ho=f((e,t)=>tr(e,"name",{value:t,configurable:!0}),"s$4");const or=ho(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let ir=class{static{f(this,"g")}static{ho(this,"FileCache")}#i;#e;#n;#t=!0;#o=new Map;constructor(t,o,i,n){this.#i=t,this.#n=i,o===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#e=o,n.debug({message:"Cache path is: "+this.#e,prefix:"file-cache"}))}set isEnabled(t){this.#t=t}has(t,o){return!this.#t||this.#e===void 0?!1:U(this.getFilePath(t,o))}get(t,o){if(!this.#t||this.#e===void 0)return;const i=this.getFilePath(t,o);if(this.#o.has(i))return this.#o.get(i);if(!U(i))return;const n=Ge(i);if(or(n)){const a=JSON.parse(n);return this.#o.set(i,a),a}return this.#o.set(i,n),n}set(t,o,i){if(!this.#t||this.#e===void 0||o===void 0)return;const n=this.getFilePath(t,i);typeof o=="object"&&(o=JSON.stringify(o)),ne(n,o,{overwrite:!0})}getFilePath(t,o){let i=t.replaceAll(we(this.#i),"");return i=i.replaceAll(":","-"),w(this.#e,this.#n,o?.replaceAll(":","-")??"",we(i))}};var nr=Object.defineProperty,ar=f((e,t)=>nr(e,"name",{value:t,configurable:!0}),"t$1");const sr=ar(async(e,t="")=>{let o=t;if(!o){const i=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"];for(const n of i)if(await De(w(e,n))){o="./"+n;break}}if(!/\.(?:js|mjs|cjs|ts|cts|mts)$/.test(o))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return o},"findPackemFile");var rr=Object.defineProperty,be=f((e,t)=>rr(e,"name",{value:t,configurable:!0}),"l$4");const pr=ee,lr=be((e,t)=>{const{sideEffects:o}=t;let i;if(typeof o=="boolean")i=be(()=>o,"hasSideEffects");else if(Array.isArray(o))if(o.length<=0)i=be(()=>!1,"hasSideEffects");else{const n=o.map(a=>a.includes("/")?a:`**/${a}`);i=pr(n,null,{resolve:e})}else i=be(()=>null,"hasSideEffects");return i},"getPackageSideEffect");var Be,St;function cr(){if(St)return Be;St=1;var e=Object.defineProperty,t=f((l,r)=>e(l,"name",{value:r,configurable:!0}),"s"),o=Ci,i=o.spawn,n=o.exec;Be=f(function(l,r,c){if(typeof r=="function"&&c===void 0&&(c=r,r=void 0),l=parseInt(l),Number.isNaN(l)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var m={},d={};switch(m[l]=[],d[l]=1,process.platform){case"win32":n("taskkill /pid "+l+" /T /F",c);break;case"darwin":p(l,m,d,function(u){return i("pgrep",["-P",u])},function(){a(m,r,c)});break;default:p(l,m,d,function(u){return i("ps",["-o","pid","--no-headers","--ppid",u])},function(){a(m,r,c)});break}},"treeKill");function a(l,r,c){var m={};try{Object.keys(l).forEach(function(d){l[d].forEach(function(u){m[u]||(s(u,r),m[u]=1)}),m[d]||(s(d,r),m[d]=1)})}catch(d){if(c)return c(d);throw d}if(c)return c()}f(a,"killAll"),t(a,"killAll");function s(l,r){try{process.kill(parseInt(l,10),r)}catch(c){if(c.code!=="ESRCH")throw c}}f(s,"killPid"),t(s,"killPid");function p(l,r,c,m,d){var u=m(l),h="";u.stdout.on("data",function(g){var g=g.toString("ascii");h+=g});var v=t(function(b){if(delete c[l],b!=0){Object.keys(c).length==0&&d();return}h.match(/\d+/g).forEach(function(g){g=parseInt(g,10),r[l].push(g),r[g]=[],c[g]=1,p(g,r,c,m,d)})},"onClose");u.on("close",v)}return f(p,"buildProcessTree"),t(p,"buildProcessTree"),Be}f(cr,"requireTreeKill");var dr=cr();const mr=fi(dr);var ur=Object.defineProperty,yo=f((e,t)=>ur(e,"name",{value:t,configurable:!0}),"l$3");const fr=yo(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),gr=yo(async({pid:e,signal:t})=>await new Promise((o,i)=>{if(!Number.isInteger(e)||e<=0){i(new Error("Invalid process ID"));return}mr(e,t,n=>{if(n&&!fr(n)){i(n);return}o()})}),"killProcess");var vr=Object.defineProperty,hr=f((e,t)=>vr(e,"name",{value:t,configurable:!0}),"n");const xo=hr(e=>{const t=w(e,"package.json");if(!U(t))throw new Error("package.json not found at "+t);return{packageJson:_i(t),packageJsonPath:t}},"loadPackageJson");var yr=Object.defineProperty,xr=f((e,t)=>yr(e,"name",{value:t,configurable:!0}),"r$2");const Ot=xr((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
98
98
  `),e.logger.warn(`Build is done with some warnings:
99
99
 
100
- ${[...e.warnings].map(i=>`- ${i}`).join(`
101
- `)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var br=Object.defineProperty,bi=f((e,t)=>br(e,"name",{value:t,configurable:!0}),"r$1");const Dt=bi(async(e,t)=>{if(typeof e.name!="string"){let i=He(e.input)?_(t.options.rootDir,e.input):q(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(Q,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);Rt(e.input)&&(e.input=$(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=$(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),wr=bi(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:lt(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:lt(t.input)});for(const t of e.options.entries.filter(i=>i.isGlob)){const{isGlob:i,...o}=t,n=["**/.git/**","**/node_modules/**","**/test-results/**"];if(e.options.rollup.watch){if(typeof e.options.rollup.watch.exclude=="string")n.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"&&n.push(s)}const a=mo([o.input],{cwd:e.options.rootDir,dot:!1,ignore:n,onlyFiles:!0});if(a.length===0)throw new Mo("No files found in the glob pattern: "+D(k(e.options.rootDir,o.input)));for(const s of a)e.options.entries.push({...o,input:$(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 Dt(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await Dt(t,e)},"prepareEntries");var kr=Object.defineProperty,jr=f((e,t)=>kr(e,"name",{value:t,configurable:!0}),"a$3");const $r=jr(async(e,t,i)=>{if(e&&await De(k(e,"keystore.json"))){const o=await Ai(k(e,"keystore.json"));let n=await Vi(e,{withFileTypes:!0});n=n.filter(s=>s.isDirectory());let a=i;for(const s of n)if(!o[s.name]){try{await Hi(k(e,s.name),{force:!0,recursive:!0})}catch(p){t.error({message:`Failed to remove cache directory ${s.name}: ${p instanceof Error?p.message:String(p)}`,prefix:"file-cache"});continue}a&&t.raw(`
100
+ ${[...e.warnings].map(o=>`- ${o}`).join(`
101
+ `)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var br=Object.defineProperty,bo=f((e,t)=>br(e,"name",{value:t,configurable:!0}),"r$1");const Dt=bo(async(e,t)=>{if(typeof e.name!="string"){let o=Xe(e.input)?_(t.options.rootDir,e.input):q(e.input);o.startsWith("./")&&(o=o.slice(2)),e.name=o.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(Q,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);Ft(e.input)&&(e.input=E(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=E(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),wr=bo(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:lt(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:lt(t.input)});for(const t of e.options.entries.filter(o=>o.isGlob)){const{...o}=t,i=["**/.git/**","**/node_modules/**","**/test-results/**"];if(e.options.rollup.watch){if(typeof e.options.rollup.watch.exclude=="string")i.push(e.options.rollup.watch.exclude);else if(Array.isArray(e.options.rollup.watch.exclude))for(const a of e.options.rollup.watch.exclude)typeof a=="string"&&i.push(a)}const n=mi([o.input],{cwd:e.options.rootDir,dot:!1,ignore:i,onlyFiles:!0});if(n.length===0)throw new Mi("No files found in the glob pattern: "+D(w(e.options.rootDir,o.input)));for(const a of n)e.options.entries.push({...o,input:E(e.options.rootDir,a)});e.options.entries.splice(e.options.entries.indexOf(t),1)}for(const t of e.options.entries.filter(o=>o.fileAlias===void 0))await Dt(t,e);for(const t of e.options.entries.filter(o=>o.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await Dt(t,e)},"prepareEntries");var kr=Object.defineProperty,jr=f((e,t)=>kr(e,"name",{value:t,configurable:!0}),"a$3");const $r=jr(async(e,t,o)=>{if(e&&await De(w(e,"keystore.json"))){const i=await Ao(w(e,"keystore.json"));let n=await Vo(e,{withFileTypes:!0});n=n.filter(s=>s.isDirectory());let a=o;for(const s of n)if(!i[s.name]){try{await Ho(w(e,s.name),{force:!0,recursive:!0})}catch(p){t.error({message:`Failed to remove cache directory ${s.name}: ${p instanceof Error?p.message:String(p)}`,prefix:"file-cache"});continue}a&&t.raw(`
102
102
 
103
- `),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var Er=Object.defineProperty,Sr=f((e,t)=>Er(e,"name",{value:t,configurable:!0}),"o");const Or=Sr(e=>{if(e.options.validation?.packageJson?.dependencies===!1)return;const t=new Set,i=new Set(Object.keys(e.pkg?.dependencies??{})),o=new Set;for(const n of e.usedImports)i.delete(n),t.add(n);if(e.pkg?.dependencies)for(const n of Object.keys(e.pkg?.dependencies))i.delete(n);for(const n of t){const a=Bt(n);!Be(e.options.externals,n)&&!n.startsWith("chunks/")&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&o.add(n)}i.size>0&&S(e,`Potential unused dependencies found: ${[...i].map(n=>D(n)).join(", ")}`),o.size>0&&S(e,`Potential implicit dependencies found: ${[...o].map(n=>D(n)).join(", ")}`)},"validateDependencies");var Dr=Object.defineProperty,wi=f((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i$1");const Pr=wi((e,t)=>Io(e,t)<=e.length/3||t.includes(e),"isSimilar"),Nr=wi((e,t)=>{const i=e.toLowerCase();return t.filter(o=>Pr(o.toLowerCase(),i))},"findAlternatives");var Cr=Object.defineProperty,Pt=f((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"r");const _r=Pt(e=>{const{options:t}=e;if(t.validation?.packageJson?.exports===!1)return;const i=t.validation?.packageJson,o=new Set([t.declaration&&i?.types?e.pkg.types:"",t.declaration&&i?.types?e.pkg.typings:"",...t.dtsOnly||i?.bin===!1?[""]:typeof e.pkg.bin=="string"?[e.pkg.bin]:Object.values(e.pkg.bin??{}),t.dtsOnly&&i?.main===!1?"":e.pkg.main,t.dtsOnly&&i?.module===!1?"":e.pkg.module,...i?.exports===!1?[]:it(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(p=>t.dtsOnly?p.subKey==="types"?p.file:void 0:p.file)].filter(Boolean).map(p=>p&&$(t.rootDir,p.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),n=[];for(const p of o)p&&!p.includes("*")&&!It(p)&&n.push(p.replace(`${t.rootDir}/`,""));const a=Pt(p=>_(t.rootDir,$(t.outDir,p)),"rPath"),s=e.buildEntries.filter(p=>!p.chunk).map(p=>a(p.path));if(n.length>0){let p="Potential missing or wrong package.json files:";for(const l of n){const r=Nr(l,s);p+=`
104
- - `+D(l)+(r.length>0?Di` (did you mean ${r.map(c=>`"${c}"`).join(", ")}?)`:"")}S(e,p)}},"validatePackageEntries");var Mr=Object.defineProperty,Ir=f((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"l$1");const Tr=Ir(e=>{const{options:{validation:t},pkg:i}=e;i.name===void 0&&t?.packageJson?.name!==!1&&S(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),t?.packageJson?.files!==!1&&(i.files===void 0?S(e,"The 'files' field is missing in your package.json. Add the files to be included in the package."):i.files.length===0?S(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))||S(e,`The 'files' field in your package.json is missing the '${e.options.outDir}' directory. Ensure the output directory is included.`));const o=i.type==="commonjs"||i.type===void 0,n=i.type==="module";if(o?(t?.packageJson?.main!==!1&&(i.main===void 0&&S(e,"The 'main' field is missing in your package.json. This field should point to your main entry file."),i.main?.includes(".mjs")&&S(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&&S(e,"The 'module' field is missing in your package.json, but you are emitting ES modules."),i.module&&i.main&&i.module===i.main&&S(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")&&S(e,"The 'module' field in your package.json should not use a '.cjs' extension for ES modules."))):n&&(i.exports===void 0&&!e.options.emitCJS?t?.packageJson?.exports!==!1&&S(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&&S(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&&S(e,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),i.module?.includes(".cjs")&&S(e,"The 'module' field should not use a '.cjs' extension for ES modules."),i.module&&i.main&&i.module===i.main&&S(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&&S(e,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports."))),i.exports,t?.packageJson?.bin!==!1){if(typeof i.bin=="string"&&i.bin.includes(o?".mjs":".cjs"))S(e,`The 'bin' field in your package.json should not use a ${o?".mjs":".cjs"} extension for ${o?"CommonJS":"ES modules"} binaries.`);else if(typeof i.bin=="object")for(const[a,s]of Object.entries(i.bin))s&&s.includes(o?".mjs":".cjs")&&S(e,`The 'bin.${a}' field in your package.json should not use a ${o?".mjs":".cjs"} extension for ${o?"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&&S(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)&&S(e,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")}},"validatePackageFields");var Ar=Object.defineProperty,Fr=f((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"i");const Rr=Fr(e=>{const{packageJson:t}=xi(e.options.rootDir);e.pkg=t,Or(e),Tr(e),_r(e)},"validator");var zr=Object.defineProperty,Jr=f((e,t)=>zr(e,"name",{value:t,configurable:!0}),"a");const Wr=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,Br=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"]),Nt=Jr(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(Wr.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(Br.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const o=$(i);if(!G(o))throw new Error(`Target path "${o}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var Lr=Object.defineProperty,z=f((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"c");const qr=z(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"),Ur=z((e,t,i,o,n,a,s,p,l)=>{const r=qr(l?.config.compilerOptions?.jsx),c=Wi(a,n,s,{alias:{},browserTargets:Ji(),cjsInterop:!1,clean:!0,debug:o,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[...nt.builtinModules,...nt.builtinModules.map(m=>`node:${m}`)],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:o,interopDefault:!0},minify:i===me,name:(p.name??"").split("/").pop()??"default",outDir:l?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!1},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dts:{compilerOptions:{baseUrl:l?.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:se,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:r,jsxDev:l?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:l?.config.compilerOptions?.jsxFactory,jsxFragment:l?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:l?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:l?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:l?.config},isolatedDeclarations:{exclude:se,ignoreErrors:!1,include:re},json:{preferConst:!0},license:{dependenciesTemplate:z((m,d,u)=>`
103
+ `),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var Er=Object.defineProperty,Sr=f((e,t)=>Er(e,"name",{value:t,configurable:!0}),"o");const Or=Sr(e=>{if(e.options.validation?.packageJson?.dependencies===!1)return;const t=new Set,o=new Set(Object.keys(e.pkg?.dependencies??{})),i=new Set;for(const n of e.usedImports)o.delete(n),t.add(n);if(e.pkg?.dependencies)for(const n of Object.keys(e.pkg?.dependencies))o.delete(n);for(const n of t){const a=Wt(n);!qe(e.options.externals,n)&&!n.startsWith("chunks/")&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&i.add(n)}o.size>0&&O(e,`Potential unused dependencies found: ${[...o].map(n=>D(n)).join(", ")}`),i.size>0&&O(e,`Potential implicit dependencies found: ${[...i].map(n=>D(n)).join(", ")}`)},"validateDependencies");var Dr=Object.defineProperty,wo=f((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i$1");const Pr=wo((e,t)=>Ii(e,t)<=e.length/3||t.includes(e),"isSimilar"),Nr=wo((e,t)=>{const o=e.toLowerCase();return t.filter(i=>Pr(i.toLowerCase(),o))},"findAlternatives");var Cr=Object.defineProperty,Pt=f((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"r");const _r=Pt(e=>{const{options:t}=e;if(t.validation?.packageJson?.exports===!1)return;const o=t.validation?.packageJson,i=new Set([t.declaration&&o?.types?e.pkg.types:"",t.declaration&&o?.types?e.pkg.typings:"",...t.dtsOnly||o?.bin===!1?[""]:typeof e.pkg.bin=="string"?[e.pkg.bin]:Object.values(e.pkg.bin??{}),t.dtsOnly&&o?.main===!1?"":e.pkg.main,t.dtsOnly&&o?.module===!1?"":e.pkg.module,...o?.exports===!1?[]:ot(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(p=>t.dtsOnly?p.subKey==="types"?p.file:void 0:p.file)].filter(Boolean).map(p=>p&&E(t.rootDir,p.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),n=[];for(const p of i)p&&!p.includes("*")&&!Qo(p)&&n.push(p.replace(`${t.rootDir}/`,""));const a=Pt(p=>_(t.rootDir,E(t.outDir,p)),"rPath"),s=e.buildEntries.filter(p=>!p.chunk).map(p=>a(p.path));if(n.length>0){let p="Potential missing or wrong package.json files:";for(const l of n){const r=Nr(l,s);p+=`
104
+ - `+D(l)+(r.length>0?Do` (did you mean ${r.map(c=>`"${c}"`).join(", ")}?)`:"")}O(e,p)}},"validatePackageEntries");var Mr=Object.defineProperty,Ir=f((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"l$1");const Tr=Ir(e=>{const{options:{validation:t},pkg:o}=e;o.name===void 0&&t?.packageJson?.name!==!1&&O(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),t?.packageJson?.files!==!1&&(o.files===void 0?O(e,"The 'files' field is missing in your package.json. Add the files to be included in the package."):o.files.length===0?O(e,"The 'files' field in your package.json is empty. Please specify the files to be included in the package."):o.files.some(a=>a.includes(e.options.outDir))||O(e,`The 'files' field in your package.json is missing the '${e.options.outDir}' directory. Ensure the output directory is included.`));const i=o.type==="commonjs"||o.type===void 0,n=o.type==="module";if(i?(t?.packageJson?.main!==!1&&(o.main===void 0&&O(e,"The 'main' field is missing in your package.json. This field should point to your main entry file."),o.main?.includes(".mjs")&&O(e,"The 'main' field in your package.json should not use a '.mjs' extension for CommonJS modules.")),t?.packageJson?.module!==!1&&(o.module===void 0&&e.options.emitESM&&O(e,"The 'module' field is missing in your package.json, but you are emitting ES modules."),o.module&&o.main&&o.module===o.main&&O(e,`Conflict detected: The 'module' and 'main' fields both point to '${o.module}'. Please ensure they refer to different module types.`),e.options.emitESM&&o.module?.includes(".cjs")&&O(e,"The 'module' field in your package.json should not use a '.cjs' extension for ES modules."))):n&&(o.exports===void 0&&!e.options.emitCJS?t?.packageJson?.exports!==!1&&O(e,"The 'exports' field is missing in your package.json. Define module exports explicitly."):e.options.emitCJS&&(t?.packageJson?.main!==!1&&o.main===void 0&&O(e,"The 'main' field is missing in your package.json. This field is needed when emitting CommonJS modules."),t?.packageJson?.module!==!1&&(o.module===void 0&&O(e,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),o.module?.includes(".cjs")&&O(e,"The 'module' field should not use a '.cjs' extension for ES modules."),o.module&&o.main&&o.module===o.main&&O(e,`Conflict detected: The 'module' and 'main' fields both point to '${o.module}'. Please ensure they refer to different module types.`)),t?.packageJson?.exports!==!1&&o.exports===void 0&&O(e,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports."))),t?.packageJson?.bin!==!1){if(typeof o.bin=="string"&&o.bin.includes(i?".mjs":".cjs"))O(e,`The 'bin' field in your package.json should not use a ${i?".mjs":".cjs"} extension for ${i?"CommonJS":"ES modules"} binaries.`);else if(typeof o.bin=="object")for(const[a,s]of Object.entries(o.bin))s&&s.includes(i?".mjs":".cjs")&&O(e,`The 'bin.${a}' field in your package.json should not use a ${i?".mjs":".cjs"} extension for ${i?"CommonJS":"ES modules"} binaries.`)}if(e.options.declaration){let a=!0;o.type==="module"&&(a=!!o.main?.endsWith(".cjs")),o.types===void 0&&o.typings===void 0&&a&&t?.packageJson?.types!==!1&&O(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&&(o.typesVersions===void 0||Object.keys(o.typesVersions).length===0)&&O(e,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")}},"validatePackageFields");var Ar=Object.defineProperty,Fr=f((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"i");const Rr=Fr(e=>{const{packageJson:t}=xo(e.options.rootDir);e.pkg=t,Or(e),Tr(e),_r(e)},"validator");var zr=Object.defineProperty,Jr=f((e,t)=>zr(e,"name",{value:t,configurable:!0}),"a");const Wr=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,Br=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"]),Nt=Jr(e=>{if(!Array.isArray(e)&&e!==null)for(const[t,o]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(Wr.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(Br.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const i=E(o);if(!U(i))throw new Error(`Target path "${i}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var Lr=Object.defineProperty,z=f((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"c");const qr=z(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"),Ur=z((e,t,o,i,n,a,s,p,l)=>{const r=qr(l?.config.compilerOptions?.jsx),c=Wo(a,n,s,{alias:{},browserTargets:Jo(),cjsInterop:!1,clean:!0,debug:i,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[...nt.builtinModules,...nt.builtinModules.map(m=>`node:${m}`)],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:i,interopDefault:!0},minify:o===me,name:(p.name??"").split("/").pop()??"default",outDir:l?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!1},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dts:{compilerOptions:{baseUrl:l?.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:se,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:r,jsxDev:l?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:l?.config.compilerOptions?.jsxFactory,jsxFragment:l?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:l?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:l?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:l?.config},isolatedDeclarations:{exclude:se,ignoreErrors:!1,include:re},json:{preferConst:!0},license:{dependenciesTemplate:z((m,d,u)=>`
105
105
  # Licenses of bundled dependencies
106
106
  The published ${u} artifact additionally contains code with the following licenses:
107
107
  `+(m.length>0?`${m.join(", ")}
@@ -115,13 +115,13 @@ The published ${u} artifact additionally contains code with the following licens
115
115
 
116
116
  `:`
117
117
  `)+`# Bundled types:
118
- `+d,"dtsTemplate")},node10Compatibility:{},patchTypes:{},polyfillNode:{},preserveDirectives:{include:re},preserveDynamicImports:!0,raw:{exclude:se,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:["module-sync"],extensions:Ye,preferBuiltins:!1},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:se,include:re},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:l?.config.compilerOptions?.esModuleInterop===!1,include:re,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:i===me,...l?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(l.config.compilerOptions.jsx)?{jsxFragmentPragma:l.config.compilerOptions.jsxFragmentFactory,jsxImportSource:l.config.compilerOptions.jsxImportSource,jsxPragma:l.config.compilerOptions.jsxFactory,jsxRuntime:r,transforms:["typescript","jsx",...l.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...l?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:re,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:l?.config.compilerOptions?.experimentalDecorators,syntax:l?"typescript":"ecmascript",[l?"tsx":"jsx"]:!0},target:l?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:l?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:l?.config.compilerOptions?.experimentalDecorators,react:{development:i!==me,pragma:l?.config.compilerOptions?.jsxFactory,pragmaFrag:l?.config.compilerOptions?.jsxFragmentFactory,runtime:r,throwIfNamespace:!0},treatConstEnumAsEnum:l?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:l?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:lr(t,p),preset:"recommended",propertyReadSideEffects:!0},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:se}},rootDir:t,sourceDir:"src",sourcemap:!1,transformerName:void 0,typedoc:{excludePrivate:!0,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:p.name??"unknown",pretty:!0,readme:"none",showConfig:o,tsconfig:l?.path}});if(!c.transformerName){const m=new Map([...Object.entries(p.dependencies??{}),...Object.entries(p.devDependencies??{})]);let d="0.0.0";if(m.has("esbuild"))c.transformerName="esbuild",d=m.get("esbuild");else if(m.has("@swc/core"))c.transformerName="swc",d=m.get("@swc/core");else if(m.has("sucrase"))c.transformerName="sucrase",d=m.get("sucrase");else throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase");e.info("Using "+D("rollup ")+Li),e.info({message:"Using "+D(c.transformerName)+" "+d,prefix:"transformer"})}return c.rollup.resolve&&c.rollup.resolve.preferBuiltins===!0&&(c.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true")),c.browserTargets&&c.browserTargets.length>0&&e.debug("Using browser targets: "+c.browserTargets.join(", ")),p.dependencies&&c.externals.push(...Object.keys(p.dependencies)),p.peerDependencies&&c.externals.push(...Object.keys(p.peerDependencies)),p.optionalDependencies&&c.externals.push(...Object.keys(p.optionalDependencies)),Nt(c.alias),c.rollup.alias&&c.rollup.alias.entries&&Nt(c.rollup.alias.entries),c},"generateOptions"),Kr=z(async(e,t,i,o,n,a,s,p,l,r)=>{const c=await Ls(s.preset??a.preset??"auto",r),m=Ur(e,t,o,n,a,s,c,p,l);Fi(k(m.rootDir,m.outDir));const d={buildEntries:[],dependencyGraphMap:new Map,environment:o,hooks:Bi(),jiti:_t(m.rootDir,m.jiti),logger:e,mode:i,options:m,pkg:p,tsconfig:l,usedImports:new Set,warnings:new Set};c.hooks&&d.hooks.addHooks(c.hooks),a.hooks&&d.hooks.addHooks(a.hooks),s.hooks&&d.hooks.addHooks(s.hooks),await d.hooks.callHook("build:prepare",d),d.options.emitESM===void 0&&d.logger.info("Emitting of ESM bundles, is disabled."),d.options.emitCJS===void 0&&d.logger.info("Emitting of CJS bundles, is disabled."),d.options.minify&&d.logger.info("Minification is enabled, the output will be minified");const u=p.dependencies?.typescript!==void 0||p.devDependencies?.typescript!==void 0;if(d.options.declaration&&d.tsconfig===void 0&&u)throw new Error("Cannot build declaration files without a tsconfig.json");return u?d.options.declaration===!1&&d.logger.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(d.options.declaration=!1,d.logger.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),d.options.declaration&&d.logger.info("Using typescript version: "+D(p.devDependencies?.typescript??p.dependencies?.typescript??"unknown")),d.options.declaration&&(p.dependencies?.typescript||p.devDependencies?.typescript)&&!d.tsconfig?.config.compilerOptions?.isolatedModules&&d.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
118
+ `+d,"dtsTemplate")},node10Compatibility:{},patchTypes:{},polyfillNode:{},preserveDirectives:{include:re},preserveDynamicImports:!0,raw:{exclude:se,include:[/\.(md|txt|htm|html|data)$/]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:["module-sync"],extensions:Ne,preferBuiltins:!1},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:se,include:re},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:l?.config.compilerOptions?.esModuleInterop===!1,include:re,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:o===me,...l?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(l.config.compilerOptions.jsx)?{jsxFragmentPragma:l.config.compilerOptions.jsxFragmentFactory,jsxImportSource:l.config.compilerOptions.jsxImportSource,jsxPragma:l.config.compilerOptions.jsxFactory,jsxRuntime:r,transforms:["typescript","jsx",...l.config.compilerOptions.esModuleInterop?["imports"]:[]]}:{transforms:["typescript",...l?.config.compilerOptions?.esModuleInterop?["imports"]:[]]}},swc:{include:re,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!1,keepClassNames:!0,loose:!0,parser:{decorators:l?.config.compilerOptions?.experimentalDecorators,syntax:l?"typescript":"ecmascript",[l?"tsx":"jsx"]:!0},target:l?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:l?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:l?.config.compilerOptions?.experimentalDecorators,react:{development:o!==me,pragma:l?.config.compilerOptions?.jsxFactory,pragmaFrag:l?.config.compilerOptions?.jsxFragmentFactory,runtime:r,throwIfNamespace:!0},treatConstEnumAsEnum:l?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:l?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:lr(t,p),preset:"recommended",propertyReadSideEffects:!0},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:se}},rootDir:t,sourceDir:"src",sourcemap:!1,transformerName:void 0,typedoc:{excludePrivate:!0,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:p.name??"unknown",pretty:!0,readme:"none",showConfig:i,tsconfig:l?.path}});if(!c.transformerName){const m=new Map([...Object.entries(p.dependencies??{}),...Object.entries(p.devDependencies??{})]);let d="0.0.0";if(m.has("esbuild"))c.transformerName="esbuild",d=m.get("esbuild");else if(m.has("@swc/core"))c.transformerName="swc",d=m.get("@swc/core");else if(m.has("sucrase"))c.transformerName="sucrase",d=m.get("sucrase");else throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase");e.info("Using "+D("rollup ")+Lo),e.info({message:"Using "+D(c.transformerName)+" "+d,prefix:"transformer"})}return c.rollup.resolve&&c.rollup.resolve.preferBuiltins===!0&&(c.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true")),c.browserTargets&&c.browserTargets.length>0&&e.debug("Using browser targets: "+c.browserTargets.join(", ")),p.dependencies&&c.externals.push(...Object.keys(p.dependencies)),p.peerDependencies&&c.externals.push(...Object.keys(p.peerDependencies)),p.optionalDependencies&&c.externals.push(...Object.keys(p.optionalDependencies)),Nt(c.alias),c.rollup.alias&&c.rollup.alias.entries&&Nt(c.rollup.alias.entries),c},"generateOptions"),Kr=z(async(e,t,o,i,n,a,s,p,l,r)=>{const c=await Ls(s.preset??a.preset??"auto",r),m=Ur(e,t,i,n,a,s,c,p,l);Fo(w(m.rootDir,m.outDir));const d={buildEntries:[],dependencyGraphMap:new Map,environment:i,hooks:Bo(),jiti:_t(m.rootDir,m.jiti),logger:e,mode:o,options:m,pkg:p,tsconfig:l,usedImports:new Set,warnings:new Set};c.hooks&&d.hooks.addHooks(c.hooks),a.hooks&&d.hooks.addHooks(a.hooks),s.hooks&&d.hooks.addHooks(s.hooks),await d.hooks.callHook("build:prepare",d),d.options.emitESM===void 0&&d.logger.info("Emitting of ESM bundles, is disabled."),d.options.emitCJS===void 0&&d.logger.info("Emitting of CJS bundles, is disabled."),d.options.minify&&d.logger.info("Minification is enabled, the output will be minified");const u=p.dependencies?.typescript!==void 0||p.devDependencies?.typescript!==void 0;if(d.options.declaration&&d.tsconfig===void 0&&u)throw new Error("Cannot build declaration files without a tsconfig.json");return u?d.options.declaration===!1&&d.logger.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(d.options.declaration=!1,d.logger.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),d.options.declaration&&d.logger.info("Using typescript version: "+D(p.devDependencies?.typescript??p.dependencies?.typescript??"unknown")),d.options.declaration&&(p.dependencies?.typescript||p.devDependencies?.typescript)&&!d.tsconfig?.config.compilerOptions?.isolatedModules&&d.logger.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
119
119
  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.
120
- 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 wr(d),d},"createContext"),Vr=z(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";default:return"Building"}},"getMode"),Vp=z(async(e,t,i,o,n={})=>{const{configPath:a,debug:s,tsconfigPath:p,...l}=n;o.wrapAll(),e=$(Me.cwd(),e),o.debug("Root directory:",e);const{packageJson:r,packageJsonPath:c}=xi(e);o.debug("Using package.json found at",c);let m;if(p){const y=k(e,p);if(!await De(y))throw new Error("tsconfig.json not found at "+y);m={config:Ri(y),path:y},o.info("Using tsconfig settings at",y)}else if(r.dependencies?.typescript||r.devDependencies?.typescript)try{m=await zi(e),o.debug("Using tsconfig settings found at",m.path)}catch{o.info("No tsconfig.json or jsconfig.json found.")}const d=Pi("@visulima/packem",{cwd:e});let u=!1,v,x;try{const y=await sr(e,a??""),g=_t(e,{debug:s});let b=await g.import(y,{default:!0,try:!0})||{};typeof b=="function"&&(b=await b(i,t)),o.debug("Using packem config found at",k(e,y));const w=H(JSON.stringify({version:r.version,...r.dependencies,...r.devDependencies,...r.peerDependencies,...r.peerDependenciesMeta,browser:r.browser,eNode:r.engines?.node,exports:r.exports,main:r.main,module:r.module,type:r.type,types:r.types}))+H(JSON.stringify(b));d&&Oo(w,d,o);const O=new or(e,d,w,o),h=await Kr(o,e,t,i,s??!1,l,b,r,m,g);O.isEnabled=h.options.fileCache,h.logger.info(D(Vr(t)+" "+h.options.name)),h.logger.debug({context:h.options.entries,message:`${L("Root dir:")} ${h.options.rootDir}
121
- ${L("Entries:")}`}),await er(h);const N=z(async R=>{for await(const[U,E]of Object.entries(h.options.builder??{})){h.logger.raw(`
122
- `),await h.hooks.callHook("builder:before",U,h);const P=Date.now(),j=z(()=>st(Math.floor(Date.now()-P)),"getBuilderDuration");await E(h,d,O,u),await h.hooks.callHook("builder:done",U,h),h.logger.raw(`
123
- ⚡️ `+U+" run in "+j()),R&&h.logger.raw(`
120
+ 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 wr(d),d},"createContext"),Vr=z(e=>{switch(e){case"jit":return"Stubbing";case"watch":return"Watching";case"tsdoc":return"Generating TSDoc";default:return"Building"}},"getMode"),Kp=z(async(e,t,o,i,n={})=>{const{configPath:a,debug:s,tsconfigPath:p,...l}=n;i.wrapAll(),e=E(Te.cwd(),e),i.debug("Root directory:",e);const{packageJson:r,packageJsonPath:c}=xo(e);i.debug("Using package.json found at",c);let m;if(p){const b=w(e,p);if(!await De(b))throw new Error("tsconfig.json not found at "+b);m={config:Ro(b),path:b},i.info("Using tsconfig settings at",b)}else if(r.dependencies?.typescript||r.devDependencies?.typescript)try{m=await zo(e),i.debug("Using tsconfig settings found at",m.path)}catch{i.info("No tsconfig.json or jsconfig.json found.")}const d=Po("@visulima/packem",{cwd:e});let u=!1,h,v;try{const b=await sr(e,a??""),g=_t(e,{debug:s});let x=await g.import(b,{default:!0,try:!0})||{};typeof x=="function"&&(x=await x(o,t)),i.debug("Using packem config found at",w(e,b));const k=G(JSON.stringify({version:r.version,...r.dependencies,...r.devDependencies,...r.peerDependencies,...r.peerDependenciesMeta,browser:r.browser,eNode:r.engines?.node,exports:r.exports,main:r.main,module:r.module,type:r.type,types:r.types}))+G(JSON.stringify(x));d&&Oi(k,d,i);const $=new ir(e,d,k,i),y=await Kr(i,e,t,o,s??!1,l,x,r,m,g);$.isEnabled=y.options.fileCache,y.logger.info(D(Vr(t)+" "+y.options.name)),y.logger.debug({context:y.options.entries,message:`${L("Root dir:")} ${y.options.rootDir}
121
+ ${L("Entries:")}`}),await er(y);const N=z(async R=>{for await(const[K,S]of Object.entries(y.options.builder??{})){y.logger.raw(`
122
+ `),await y.hooks.callHook("builder:before",K,y);const P=Date.now(),j=z(()=>st(Math.floor(Date.now()-P)),"getBuilderDuration");await S(y,d,$,u),await y.hooks.callHook("builder:done",K,y),y.logger.raw(`
123
+ ⚡️ `+K+" run in "+j()),R&&y.logger.raw(`
124
124
 
125
- `)}},"runBuilder"),M=z(async()=>{if(v!==void 0)await gr({pid:v.pid,signal:l.killSignal??b.killSignal??"SIGTERM"});else if(x!==void 0)try{await x()}catch(R){throw new Error("onSuccess function cleanup failed: "+R.message,{cause:R})}v=void 0,x=void 0},"doOnSuccessCleanup"),J=z(async()=>{if(typeof h.options.onSuccess=="function")try{x=await h.options.onSuccess()}catch(R){throw new Error("onSuccess function failed: "+R.message,{cause:R})}else if(typeof h.options.onSuccess=="string"){const R=h.options.onSuccessTimeout??3e4;if(v=qi(h.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:R}}),await v,v.exitCode&&v.exitCode!==0)throw new Error("onSuccess script failed with exit code "+v.exitCode+". Check the output above for details.")}},"runOnsuccess"),F=Date.now(),ie=z(()=>st(Math.floor(Date.now()-F)),"getDuration");if(t==="watch"){if(h.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem.config file.");await Ys(h,O,N,J,M),Ot(h,!1);return}t==="jit"?(await Ks(h),await h.hooks.callHook("build:done",h)):(u=await Es(h,O),await h.hooks.callHook("validate:before",h),Rr(h),await h.hooks.callHook("validate:done",h),Ot(h,u)),h.logger.raw(`
126
- ⚡️ Build run in `+ie()),await N(),await J(),Me.on("SIGINT",async()=>{await M()}),Me.on("SIGTERM",async()=>{await M()})}catch(y){throw o.raw(`
127
- `),gi(y),y}finally{o.restoreAll(),await $r(d,o,u)}},"packem");export{Vp as default};
125
+ `)}},"runBuilder"),M=z(async()=>{if(h!==void 0)await gr({pid:h.pid,signal:l.killSignal??x.killSignal??"SIGTERM"});else if(v!==void 0)try{await v()}catch(R){throw new Error("onSuccess function cleanup failed: "+R.message,{cause:R})}h=void 0,v=void 0},"doOnSuccessCleanup"),J=z(async()=>{if(typeof y.options.onSuccess=="function")try{v=await y.options.onSuccess()}catch(R){throw new Error("onSuccess function failed: "+R.message,{cause:R})}else if(typeof y.options.onSuccess=="string"){const R=y.options.onSuccessTimeout??3e4;if(h=qo(y.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:R}}),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"),F=Date.now(),oe=z(()=>st(Math.floor(Date.now()-F)),"getDuration");if(t==="watch"){if(y.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem.config file.");await Ys(y,$,N,J,M),Ot(y,!1);return}t==="jit"?(await Ks(y),await y.hooks.callHook("build:done",y)):(u=await Es(y,$),await y.hooks.callHook("validate:before",y),Rr(y),await y.hooks.callHook("validate:done",y),Ot(y,u)),y.logger.raw(`
126
+ ⚡️ Build run in `+oe()),await N(),await J(),Te.on("SIGINT",async()=>{await M()}),Te.on("SIGTERM",async()=>{await M()})}catch(b){throw i.raw(`
127
+ `),go(b),b}finally{i.restoreAll(),await $r(d,i,u)}},"packem");export{Kp as default};