@visulima/packem 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/builder/typedoc/index.cjs +1 -1
- package/dist/builder/typedoc/index.mjs +1 -1
- package/dist/cli.mjs +13 -13
- package/dist/packem.cjs +2 -2
- package/dist/packem.mjs +2 -2
- package/dist/packem_shared/{Mime-CNzz9C62.mjs → Mime-BAOJBnwv.mjs} +1 -1
- package/dist/packem_shared/{Mime-BsyBfmma.cjs → Mime-DYEFNPhY.cjs} +1 -1
- package/dist/packem_shared/{create-or-update-key-storage-BxGi6kMH.mjs → create-or-update-key-storage-DqBj3nUO.mjs} +1 -1
- package/dist/packem_shared/{create-or-update-key-storage-DOolYH4A.cjs → create-or-update-key-storage-j3JKDA99.cjs} +1 -1
- package/dist/packem_shared/{resolve-aYsRgS8e.mjs → resolve-CcpYTonY.mjs} +1 -1
- package/dist/packem_shared/{resolve-CisvRjnr.cjs → resolve-DSG4Zlek.cjs} +1 -1
- package/dist/rollup/plugins/css/loaders/less/index.cjs +1 -1
- package/dist/rollup/plugins/css/loaders/less/index.mjs +1 -1
- package/dist/rollup/plugins/css/loaders/postcss/index.cjs +1 -1
- package/dist/rollup/plugins/css/loaders/postcss/index.mjs +1 -1
- package/dist/rollup/plugins/css/loaders/sass/index.cjs +1 -1
- package/dist/rollup/plugins/css/loaders/sass/index.mjs +1 -1
- package/package.json +10 -10
package/dist/cli.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
|
5
5
|
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
7
7
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
8
|
-
const wn="@visulima/packem",kn="1.9.
|
|
8
|
+
const wn="@visulima/packem",kn="1.9.1";var jn=Object.defineProperty,$n=g((e,t)=>jn(e,"name",{value:t,configurable:!0}),"t$d");const ki=$n(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 Ve(j(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"),ji={less:["less"],lightningcss:["lightningcss"],"node-sass":["node-sass"],postcss:["postcss","postcss-load-config","postcss-modules-extract-imports","postcss-modules-local-by-default","postcss-modules-scope","postcss-modules-values","postcss-value-parser","icss-utils"],sass:["sass"],"sass-embedded":["sass-embedded"],stylus:["stylus"]};var En=Object.defineProperty,It=g((e,t)=>En(e,"name",{value:t,configurable:!0}),"f$j");const Sn=["typedoc","typedoc-plugin-markdown","typedoc-plugin-rename-defaults","@ckeditor/typedoc-plugins"],On=It(e=>{e.addCommand({argument:{description:"Add a packem feature to your project",name:"feature",required:!0},description:"Add a optional packem feature to your project",execute:It(async({argument:t,logger:i,options:o})=>{const n=mt(),a=S(pi(),o.dir??".");let s;try{s=await ki(a,o.config)}catch{i.error("Could not find a packem config file, please run `packem init` first.");return}const l=await Se(s,{buffer:!1});let p="cjs";l.includes("import")&&(p="esm");const r=new H(l);if(t.includes("typedoc")){if(l.includes("typedoc: typedocBuilder")||l.includes("@visulima/packem/builder/typedoc")){i.warn("Typedoc has already been added to the packem config.");return}p==="cjs"?r.prepend(`const typedocBuilder = require("@visulima/packem/builder/typedoc");
|
|
9
9
|
`):r.prepend(`import typedocBuilder from "@visulima/packem/builder/typedoc";
|
|
10
10
|
`),l.includes("builder: {")?r.replace("builder: {",`builder: {
|
|
11
11
|
typedoc: typedocBuilder,
|
|
@@ -29,15 +29,15 @@ Typedoc added!`)}if(t.includes("css")){if(l.includes("css: {")||l.includes("@vis
|
|
|
29
29
|
loaders: [${h}],
|
|
30
30
|
},
|
|
31
31
|
},`)}n.start("Installing packages"),await dt(u,{cwd:a,dev:!0,silent:!0}),n.stop("Installed packages"),i.success(`
|
|
32
|
-
CSS loaders added!`)}await di(s,r.toString(),{overwrite:!0})},"execute"),name:"add",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{description:"Use a custom config file",name:"config",type:String}]})},"createAddCommand"),He=[".mjs",".js",".json",".node",".cjs",".ts",".cts",".mts",".tsx",".ctsx",".mtsx",".jsx"],G="production",Oe="development",kt=new Set(["react-server","react-native","edge-light"]),Je=new Set([Oe,G,...kt]),he=/node_modules/,ae=/(?:\.d\.[mc]?tsx?|\.\w+)$/,Pn="packem_chunks",Dn="packem_shared",xe=/\.(?:m|c)?(?:j|t)sx?$/;var Cn=Object.defineProperty,Nn=g((e,t)=>Cn(e,"name",{value:t,configurable:!0}),"a$t");const Ee=Nn(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var _n=Object.defineProperty,$i=g((e,t)=>_n(e,"name",{value:t,configurable:!0}),"s$j");const Mn=$i((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 l=e(...n);return o.set(a,l),l}},"memoize"),Tn=$i(e=>{const t=new Map;return i=>Mn(e,i,t)},"memoizeByKey");var In=Object.defineProperty,De=g((e,t)=>In(e,"name",{value:t,configurable:!0}),"r$
|
|
32
|
+
CSS loaders added!`)}await di(s,r.toString(),{overwrite:!0})},"execute"),name:"add",options:[{defaultValue:".",description:"The directory to build",name:"dir",type:String},{description:"Use a custom config file",name:"config",type:String}]})},"createAddCommand"),He=[".mjs",".js",".json",".node",".cjs",".ts",".cts",".mts",".tsx",".ctsx",".mtsx",".jsx"],G="production",Oe="development",kt=new Set(["react-server","react-native","edge-light"]),Je=new Set([Oe,G,...kt]),he=/node_modules/,ae=/(?:\.d\.[mc]?tsx?|\.\w+)$/,Pn="packem_chunks",Dn="packem_shared",xe=/\.(?:m|c)?(?:j|t)sx?$/;var Cn=Object.defineProperty,Nn=g((e,t)=>Cn(e,"name",{value:t,configurable:!0}),"a$t");const Ee=Nn(e=>e==null?[]:Array.isArray(e)?e:[e],"arrayify");var _n=Object.defineProperty,$i=g((e,t)=>_n(e,"name",{value:t,configurable:!0}),"s$j");const Mn=$i((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 l=e(...n);return o.set(a,l),l}},"memoize"),Tn=$i(e=>{const t=new Map;return i=>Mn(e,i,t)},"memoizeByKey");var In=Object.defineProperty,De=g((e,t)=>In(e,"name",{value:t,configurable:!0}),"r$i");const An=De(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:t}=e.declaration;Le(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 Go(t.id))yield i;break}}},"exportName"),zn=De(function*(e){if(e.declaration)for(const t of An(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"),Rn=De(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),Fn=De(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),Ln=De(function*(e,t){Le(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*Rn(o);break}case"ExportDefaultDeclaration":{yield*Fn();break}case"ExportNamedDeclaration":{yield*zn(o);break}}},"parseExports");var Jn=Object.defineProperty,Ce=g((e,t)=>Jn(e,"name",{value:t,configurable:!0}),"n$f");const Ei=Ce(async function(e,t,i){const o=await e.resolve(t,i.id);if(Le(o,`Rollup can't resolve ${t} from ${i.id}`),o.external)return null;const n=await e.load(o);return Le(n,`Rollup doesn't have a module for id ${o.id}`),n},"getImportedModule"),Bn=Ce(async function*(e,t,i){const o=await Ei(e,t.source,i);o&&(yield*jt(e,o))},"gatherBarrelReExports"),qn=Ce(async function*(e,t,i){const o=await Ei(e,t.source,i);if(!o)return;const n=new Map(t.bindings.map(a=>[a.importedName,a]));for await(const a of jt(e,o)){const s=n.get(a.exportedName);s&&(yield{...a,exportedName:s.exportedName})}},"gatherNamedReExports"),Wn=Ce(async function*(e,t){yield{exportedName:t.exportedName,id:e.id,sourceName:t.exportedName}},"gatherNamedSelfExports"),jt=Ce(async function*(e,t){for(const i of Ln(e,t))i.from==="self"?yield*Wn(t,i):i.type==="barrel"?yield*Bn(e,i,t):yield*qn(e,i,t)},"gatherExports");var Un=Object.defineProperty,Vn=g((e,t)=>Un(e,"name",{value:t,configurable:!0}),"r$h");const Kn=Vn(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const t of jt(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 Gn=Object.defineProperty,Hn=g((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"r$g");const Yn=Hn((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 Xn=Object.defineProperty,Qn=g((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"a$s");const Si=Qn(e=>{const t=Yn(/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 H(e);return n.replace(new RegExp(`(,s)?${o} as default(,)?`),""),n.replace(new RegExp(`export default ${o};
|
|
33
33
|
?`),""),n.append(`
|
|
34
34
|
|
|
35
35
|
export = `+o+";"),{code:n.toString().replace(/export\s\{\s\s\};/,""),map:n.generateMap({hires:!0})}}return null},"patchCjsDefaultExport");var Zn=Object.defineProperty,At=g((e,t)=>Zn(e,"name",{value:t,configurable:!0}),"i$g");const Oi=At(({addDefaultProperty:e=!1,logger:t,type:i})=>({name:"packem:cjs-interop",renderChunk:At(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 l=new H(o);l.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),l.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&l.append(`
|
|
36
|
-
module.exports.default = `+s[2]+";");let p=l.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:l.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?i!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:Si(o):null},"renderChunk")}),"cjsInteropPlugin");var ea=Object.defineProperty,ta=g((e,t)=>ea(e,"name",{value:t,configurable:!0}),"f$g");const ia=ta((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(l=>({...s,src:l})):s).map(async s=>await Yo(Ee(s.src),{ignore:Ee(s.exclude).filter(Boolean)}).then(l=>({dest:s.dest??"",parent:Ho(s.src),src:l}))));for(const s of a)for(const l of s.src){let p;i.has(l)?p=i.get(l):(p={copied:[],dest:[],timestamp:0},i.set(l,p));const r=o.flatten?K(s.dest):j(s.dest,_(s.parent,T(l)));p.dest.includes(r)||p.dest.push(r),this.addWatchFile(l)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,l])=>{let p;try{const r=await bt(s);if(!r.isFile())return;const c=r.mtime.getTime();c>l.timestamp&&(l.timestamp=c,l.copied=[]),p=await Se(s,{buffer:!0})}catch(r){t.error({context:[r],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const r of l.dest){if(o.copyOnce&&l.copied.includes(r))continue;const c=ne(s),m=j(r,c);try{this.emitFile({[o.exactFileNames?"fileName":"name"]:m,source:p,type:"asset"}),t.debug({message:`copied ${s} → ${m}`,prefix:"plugin:copy"}),l.copied.push(r)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${m}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");function Pi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Pi,"getDefaultExportFromCjs");var st={exports:{}},zt;function oa(){return zt||(zt=1,function(e){var t=Object.defineProperty,i=g((c,m)=>t(c,"name",{value:m,configurable:!0}),"c"),o=Object.prototype.hasOwnProperty,n="~";function a(){}g(a,"Events"),i(a,"Events"),Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function s(c,m,d){this.fn=c,this.context=m,this.once=d||!1}g(s,"EE"),i(s,"EE");function l(c,m,d,u,y){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new s(d,u||c,y),h=n?n+m:m;return c._events[h]?c._events[h].fn?c._events[h]=[c._events[h],v]:c._events[h].push(v):(c._events[h]=v,c._eventsCount++),c}g(l,"addListener"),i(l,"addListener");function p(c,m){--c._eventsCount===0?c._events=new a:delete c._events[m]}g(p,"clearEvent"),i(p,"clearEvent");function r(){this._events=new a,this._eventsCount=0}g(r,"EventEmitter"),i(r,"EventEmitter"),r.prototype.eventNames=i(function(){var c=[],m,d;if(this._eventsCount===0)return c;for(d in m=this._events)o.call(m,d)&&c.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(m)):c},"eventNames"),r.prototype.listeners=i(function(c){var m=n?n+c:c,d=this._events[m];if(!d)return[];if(d.fn)return[d.fn];for(var u=0,y=d.length,v=new Array(y);u<y;u++)v[u]=d[u].fn;return v},"listeners"),r.prototype.listenerCount=i(function(c){var m=n?n+c:c,d=this._events[m];return d?d.fn?1:d.length:0},"listenerCount"),r.prototype.emit=i(function(c,m,d,u,y,v){var h=n?n+c:c;if(!this._events[h])return!1;var f=this._events[h],x=arguments.length,k,w;if(f.fn){switch(f.once&&this.removeListener(c,f.fn,void 0,!0),x){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,m),!0;case 3:return f.fn.call(f.context,m,d),!0;case 4:return f.fn.call(f.context,m,d,u),!0;case 5:return f.fn.call(f.context,m,d,u,y),!0;case 6:return f.fn.call(f.context,m,d,u,y,v),!0}for(w=1,k=new Array(x-1);w<x;w++)k[w-1]=arguments[w];f.fn.apply(f.context,k)}else{var b=f.length,$;for(w=0;w<b;w++)switch(f[w].once&&this.removeListener(c,f[w].fn,void 0,!0),x){case 1:f[w].fn.call(f[w].context);break;case 2:f[w].fn.call(f[w].context,m);break;case 3:f[w].fn.call(f[w].context,m,d);break;case 4:f[w].fn.call(f[w].context,m,d,u);break;default:if(!k)for($=1,k=new Array(x-1);$<x;$++)k[$-1]=arguments[$];f[w].fn.apply(f[w].context,k)}}return!0},"emit"),r.prototype.on=i(function(c,m,d){return l(this,c,m,d,!1)},"on"),r.prototype.once=i(function(c,m,d){return l(this,c,m,d,!0)},"once"),r.prototype.removeListener=i(function(c,m,d,u){var y=n?n+c:c;if(!this._events[y])return this;if(!m)return p(this,y),this;var v=this._events[y];if(v.fn)v.fn===m&&(!u||v.once)&&(!d||v.context===d)&&p(this,y);else{for(var h=0,f=[],x=v.length;h<x;h++)(v[h].fn!==m||u&&!v[h].once||d&&v[h].context!==d)&&f.push(v[h]);f.length?this._events[y]=f.length===1?f[0]:f:p(this,y)}return this},"removeListener"),r.prototype.removeAllListeners=i(function(c){var m;return c?(m=n?n+c:c,this._events[m]&&p(this,m)):(this._events=new a,this._eventsCount=0),this},"removeAllListeners"),r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=n,r.EventEmitter=r,e.exports=r}(st)),st.exports}g(oa,"requireEventemitter3");var na=oa();const aa=Pi(na);var sa=Object.defineProperty,fe=g((e,t)=>sa(e,"name",{value:t,configurable:!0}),"o$7");class Di extends Error{static{g(this,"TimeoutError")}static{fe(this,"TimeoutError")}constructor(t){super(t),this.name="TimeoutError"}}class ra extends Error{static{g(this,"AbortError")}static{fe(this,"AbortError")}constructor(t){super(),this.name="AbortError",this.message=t}}const Rt=fe(e=>globalThis.DOMException===void 0?new ra(e):new DOMException(e),"getDOMException"),Ft=fe(e=>{const t=e.reason===void 0?Rt("This operation was aborted."):e.reason;return t instanceof Error?t:Rt(t)},"getAbortedReason");function Ci(e,t){const{milliseconds:i,fallback:o,message:n,customTimers:a={setTimeout,clearTimeout}}=t;let s;const l=new Promise((p,r)=>{if(typeof i!="number"||Math.sign(i)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${i}\``);if(t.signal){const{signal:m}=t;m.aborted&&r(Ft(m));const d=fe(()=>{r(Ft(m))},"abortHandler");m.addEventListener("abort",d,{once:!0}),e.finally(()=>{m.removeEventListener("abort",d)})}if(i===Number.POSITIVE_INFINITY){e.then(p,r);return}const c=new Di;s=a.setTimeout.call(void 0,()=>{if(o){try{p(o())}catch(m){r(m)}return}typeof e.cancel=="function"&&e.cancel(),n===!1?p():n instanceof Error?r(n):(c.message=n??`Promise timed out after ${i} milliseconds`,r(c))},i),(async()=>{try{p(await e)}catch(m){r(m)}})()}).finally(()=>{l.clear()});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}g(Ci,"T");fe(Ci,"pTimeout");var la=Object.defineProperty,pa=g((e,t)=>la(e,"name",{value:t,configurable:!0}),"i$f");function Ni(e,t,i){let o=0,n=e.length;for(;n>0;){const a=Math.trunc(n/2);let s=o+a;i(e[s],t)<=0?(o=++s,n-=a+1):n=a}return o}g(Ni,"r$g");pa(Ni,"lowerBound");var ca=Object.defineProperty,da=g((e,t)=>ca(e,"name",{value:t,configurable:!0}),"s$g");let ma=class{static{g(this,"y")}static{da(this,"PriorityQueue")}#e=[];enqueue(t,i){i={priority:0,...i};const o={priority:i.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=i.priority){this.#e.push(o);return}const n=Ni(this.#e,o,(a,s)=>s.priority-a.priority);this.#e.splice(n,0,o)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(i=>i.priority===t.priority).map(i=>i.run)}get size(){return this.#e.length}};var ua=Object.defineProperty,Lt=g((e,t)=>ua(e,"name",{value:t,configurable:!0}),"n$c");let fa=class extends aa{static{g(this,"d")}static{Lt(this,"PQueue")}#e;#i;#a=0;#r;#s;#f=0;#o;#p;#t;#g;#n=0;#c;#l;#v;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ma,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#i=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#g=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#v=t.throwOnTimeout===!0,this.#l=t.autoStart===!1}get#y(){return this.#i||this.#a<this.#r}get#b(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#k(){this.#x(),this.#h(),this.#p=void 0}get#j(){const t=Date.now();if(this.#o===void 0){const i=this.#f-t;if(i<0)this.#a=this.#e?this.#n:0;else return this.#p===void 0&&(this.#p=setTimeout(()=>{this.#k()},i)),!0}return!1}#d(){if(this.#t.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#l){const t=!this.#j;if(this.#y&&this.#b){const i=this.#t.dequeue();return i?(this.emit("active"),i(),t&&this.#h(),!0):!1}}return!1}#h(){this.#i||this.#o!==void 0||(this.#o=setInterval(()=>{this.#x()},this.#s),this.#f=Date.now()+this.#s)}#x(){this.#a===0&&this.#n===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#a=this.#e?this.#n:0,this.#m()}#m(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#m()}async#$(t){return new Promise((i,o)=>{t.addEventListener("abort",()=>{o(t.reason)},{once:!0})})}async add(t,i={}){return i={timeout:this.timeout,throwOnTimeout:this.#v,...i},new Promise((o,n)=>{this.#t.enqueue(async()=>{this.#n++,this.#a++;try{i.signal?.throwIfAborted();let a=t({signal:i.signal});i.timeout&&(a=Ci(Promise.resolve(a),{milliseconds:i.timeout})),i.signal&&(a=Promise.race([a,this.#$(i.signal)]));const s=await a;o(s),this.emit("completed",s)}catch(a){if(a instanceof Di&&!i.throwOnTimeout){o();return}n(a),this.emit("error",a)}finally{this.#w()}},i),this.emit("add"),this.#d()})}async addAll(t,i){return Promise.all(t.map(async o=>this.add(o,i)))}start(){return this.#l?(this.#l=!1,this.#m(),this):this}pause(){this.#l=!0}clear(){this.#t=new this.#g}async onEmpty(){this.#t.size!==0&&await this.#u("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#u("next",()=>this.#t.size<t)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#u("idle")}async#u(t,i){return new Promise(o=>{const n=Lt(()=>{i&&!i()||(this.off(t,n),o())},"listener");this.on(t,n)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#l}};var ga=Object.defineProperty,va=g((e,t)=>ga(e,"name",{value:t,configurable:!0}),"r$f");const Jt=va((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 ha=Object.defineProperty,xa=g((e,t)=>ha(e,"name",{value:t,configurable:!0}),"a$r");const ya=4,ba=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):ya;let wa=class{static{g(this,"f")}static{xa(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(Jt(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new fa({concurrency:ba-1}));for await(const[o,n]of this.loaders){const a={...i,options:this.options[o]??{}};if(n.alwaysProcess||Jt(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}};const ka=/data:[^\n\r;]+(?:;charset=[^\n\r;]+)?;base64,([\d+/A-Za-z]+={0,2})/;var ja=Object.defineProperty,Ye=g((e,t)=>ja(e,"name",{value:t,configurable:!0}),"i$e");const _i=/(?:\n|\r\n)?\/\*[#*@]+\s*sourceMappingURL\s*=\s*(\S+)\s*\*+\//g,Mi=/(?:\n|\r\n)?\/\/[#@]+\s*sourceMappingURL\s*=\s*(\S+)\s*?$/gm;let $a=class{static{g(this,"S")}static{Ye(this,"MapModifier")}map;constructor(t){if(typeof t=="string")try{this.map=JSON.parse(t)}catch{}else this.map=t}modify(t){return this.map?(t(this.map),this):this}modifySources(t){return this.map?(this.map.sources&&(this.map.sources=this.map.sources.map(i=>t(i))),this):this}resolve(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:S(t,i))}relative(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:Pe(i)?_(t,i):K(i))}toObject(){return this.map}toString(){return this.map?JSON.stringify(this.map):this.map}toConsumer(){return this.map?new Zo(this.map):this.map}toCommentData(){const t=this.toString();return t?`
|
|
36
|
+
module.exports.default = `+s[2]+";");let p=l.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),t.debug({message:"Applied CommonJS interop to entry chunk "+n.fileName+".",prefix:"plugin:cjs-interop"}),{code:p,map:l.generateMap({hires:!0})}}return a.format==="es"&&/\.d\.(?:ts|cts)$/.test(n.fileName)?i!=="commonjs"&&n.fileName.endsWith(".d.mts")?null:Si(o):null},"renderChunk")}),"cjsInteropPlugin");var ea=Object.defineProperty,ta=g((e,t)=>ea(e,"name",{value:t,configurable:!0}),"f$g");const ia=ta((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(l=>({...s,src:l})):s).map(async s=>await Yo(Ee(s.src),{ignore:Ee(s.exclude).filter(Boolean)}).then(l=>({dest:s.dest??"",parent:Ho(s.src),src:l}))));for(const s of a)for(const l of s.src){let p;i.has(l)?p=i.get(l):(p={copied:[],dest:[],timestamp:0},i.set(l,p));const r=o.flatten?K(s.dest):j(s.dest,_(s.parent,T(l)));p.dest.includes(r)||p.dest.push(r),this.addWatchFile(l)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...i].map(async([s,l])=>{let p;try{const r=await bt(s);if(!r.isFile())return;const c=r.mtime.getTime();c>l.timestamp&&(l.timestamp=c,l.copied=[]),p=await Se(s,{buffer:!0})}catch(r){t.error({context:[r],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const r of l.dest){if(o.copyOnce&&l.copied.includes(r))continue;const c=ne(s),m=j(r,c);try{this.emitFile({[o.exactFileNames?"fileName":"name"]:m,source:p,type:"asset"}),t.debug({message:`copied ${s} → ${m}`,prefix:"plugin:copy"}),l.copied.push(r)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${m}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");function Pi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Pi,"getDefaultExportFromCjs");var st={exports:{}},zt;function oa(){return zt||(zt=1,function(e){var t=Object.defineProperty,i=g((c,m)=>t(c,"name",{value:m,configurable:!0}),"c"),o=Object.prototype.hasOwnProperty,n="~";function a(){}g(a,"Events"),i(a,"Events"),Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function s(c,m,d){this.fn=c,this.context=m,this.once=d||!1}g(s,"EE"),i(s,"EE");function l(c,m,d,u,y){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new s(d,u||c,y),h=n?n+m:m;return c._events[h]?c._events[h].fn?c._events[h]=[c._events[h],v]:c._events[h].push(v):(c._events[h]=v,c._eventsCount++),c}g(l,"addListener"),i(l,"addListener");function p(c,m){--c._eventsCount===0?c._events=new a:delete c._events[m]}g(p,"clearEvent"),i(p,"clearEvent");function r(){this._events=new a,this._eventsCount=0}g(r,"EventEmitter"),i(r,"EventEmitter"),r.prototype.eventNames=i(function(){var c=[],m,d;if(this._eventsCount===0)return c;for(d in m=this._events)o.call(m,d)&&c.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(m)):c},"eventNames"),r.prototype.listeners=i(function(c){var m=n?n+c:c,d=this._events[m];if(!d)return[];if(d.fn)return[d.fn];for(var u=0,y=d.length,v=new Array(y);u<y;u++)v[u]=d[u].fn;return v},"listeners"),r.prototype.listenerCount=i(function(c){var m=n?n+c:c,d=this._events[m];return d?d.fn?1:d.length:0},"listenerCount"),r.prototype.emit=i(function(c,m,d,u,y,v){var h=n?n+c:c;if(!this._events[h])return!1;var f=this._events[h],x=arguments.length,k,w;if(f.fn){switch(f.once&&this.removeListener(c,f.fn,void 0,!0),x){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,m),!0;case 3:return f.fn.call(f.context,m,d),!0;case 4:return f.fn.call(f.context,m,d,u),!0;case 5:return f.fn.call(f.context,m,d,u,y),!0;case 6:return f.fn.call(f.context,m,d,u,y,v),!0}for(w=1,k=new Array(x-1);w<x;w++)k[w-1]=arguments[w];f.fn.apply(f.context,k)}else{var b=f.length,$;for(w=0;w<b;w++)switch(f[w].once&&this.removeListener(c,f[w].fn,void 0,!0),x){case 1:f[w].fn.call(f[w].context);break;case 2:f[w].fn.call(f[w].context,m);break;case 3:f[w].fn.call(f[w].context,m,d);break;case 4:f[w].fn.call(f[w].context,m,d,u);break;default:if(!k)for($=1,k=new Array(x-1);$<x;$++)k[$-1]=arguments[$];f[w].fn.apply(f[w].context,k)}}return!0},"emit"),r.prototype.on=i(function(c,m,d){return l(this,c,m,d,!1)},"on"),r.prototype.once=i(function(c,m,d){return l(this,c,m,d,!0)},"once"),r.prototype.removeListener=i(function(c,m,d,u){var y=n?n+c:c;if(!this._events[y])return this;if(!m)return p(this,y),this;var v=this._events[y];if(v.fn)v.fn===m&&(!u||v.once)&&(!d||v.context===d)&&p(this,y);else{for(var h=0,f=[],x=v.length;h<x;h++)(v[h].fn!==m||u&&!v[h].once||d&&v[h].context!==d)&&f.push(v[h]);f.length?this._events[y]=f.length===1?f[0]:f:p(this,y)}return this},"removeListener"),r.prototype.removeAllListeners=i(function(c){var m;return c?(m=n?n+c:c,this._events[m]&&p(this,m)):(this._events=new a,this._eventsCount=0),this},"removeAllListeners"),r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=n,r.EventEmitter=r,e.exports=r}(st)),st.exports}g(oa,"requireEventemitter3");var na=oa();const aa=Pi(na);var sa=Object.defineProperty,fe=g((e,t)=>sa(e,"name",{value:t,configurable:!0}),"o$7");class Di extends Error{static{g(this,"TimeoutError")}static{fe(this,"TimeoutError")}constructor(t){super(t),this.name="TimeoutError"}}class ra extends Error{static{g(this,"AbortError")}static{fe(this,"AbortError")}constructor(t){super(),this.name="AbortError",this.message=t}}const Rt=fe(e=>globalThis.DOMException===void 0?new ra(e):new DOMException(e),"getDOMException"),Ft=fe(e=>{const t=e.reason===void 0?Rt("This operation was aborted."):e.reason;return t instanceof Error?t:Rt(t)},"getAbortedReason");function Ci(e,t){const{milliseconds:i,fallback:o,message:n,customTimers:a={setTimeout,clearTimeout}}=t;let s;const l=new Promise((p,r)=>{if(typeof i!="number"||Math.sign(i)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${i}\``);if(t.signal){const{signal:m}=t;m.aborted&&r(Ft(m));const d=fe(()=>{r(Ft(m))},"abortHandler");m.addEventListener("abort",d,{once:!0}),e.finally(()=>{m.removeEventListener("abort",d)})}if(i===Number.POSITIVE_INFINITY){e.then(p,r);return}const c=new Di;s=a.setTimeout.call(void 0,()=>{if(o){try{p(o())}catch(m){r(m)}return}typeof e.cancel=="function"&&e.cancel(),n===!1?p():n instanceof Error?r(n):(c.message=n??`Promise timed out after ${i} milliseconds`,r(c))},i),(async()=>{try{p(await e)}catch(m){r(m)}})()}).finally(()=>{l.clear()});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}g(Ci,"T");fe(Ci,"pTimeout");var la=Object.defineProperty,pa=g((e,t)=>la(e,"name",{value:t,configurable:!0}),"i$f");function Ni(e,t,i){let o=0,n=e.length;for(;n>0;){const a=Math.trunc(n/2);let s=o+a;i(e[s],t)<=0?(o=++s,n-=a+1):n=a}return o}g(Ni,"r$f");pa(Ni,"lowerBound");var ca=Object.defineProperty,da=g((e,t)=>ca(e,"name",{value:t,configurable:!0}),"s$g");let ma=class{static{g(this,"y")}static{da(this,"PriorityQueue")}#e=[];enqueue(t,i){i={priority:0,...i};const o={priority:i.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=i.priority){this.#e.push(o);return}const n=Ni(this.#e,o,(a,s)=>s.priority-a.priority);this.#e.splice(n,0,o)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(i=>i.priority===t.priority).map(i=>i.run)}get size(){return this.#e.length}};var ua=Object.defineProperty,Lt=g((e,t)=>ua(e,"name",{value:t,configurable:!0}),"n$c");let fa=class extends aa{static{g(this,"d")}static{Lt(this,"PQueue")}#e;#i;#a=0;#r;#s;#f=0;#o;#p;#t;#g;#n=0;#c;#l;#v;timeout;constructor(t){if(super(),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ma,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#i=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#g=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#v=t.throwOnTimeout===!0,this.#l=t.autoStart===!1}get#y(){return this.#i||this.#a<this.#r}get#b(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#k(){this.#x(),this.#h(),this.#p=void 0}get#j(){const t=Date.now();if(this.#o===void 0){const i=this.#f-t;if(i<0)this.#a=this.#e?this.#n:0;else return this.#p===void 0&&(this.#p=setTimeout(()=>{this.#k()},i)),!0}return!1}#d(){if(this.#t.size===0)return this.#o&&clearInterval(this.#o),this.#o=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#l){const t=!this.#j;if(this.#y&&this.#b){const i=this.#t.dequeue();return i?(this.emit("active"),i(),t&&this.#h(),!0):!1}}return!1}#h(){this.#i||this.#o!==void 0||(this.#o=setInterval(()=>{this.#x()},this.#s),this.#f=Date.now()+this.#s)}#x(){this.#a===0&&this.#n===0&&this.#o&&(clearInterval(this.#o),this.#o=void 0),this.#a=this.#e?this.#n:0,this.#m()}#m(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#m()}async#$(t){return new Promise((i,o)=>{t.addEventListener("abort",()=>{o(t.reason)},{once:!0})})}async add(t,i={}){return i={timeout:this.timeout,throwOnTimeout:this.#v,...i},new Promise((o,n)=>{this.#t.enqueue(async()=>{this.#n++,this.#a++;try{i.signal?.throwIfAborted();let a=t({signal:i.signal});i.timeout&&(a=Ci(Promise.resolve(a),{milliseconds:i.timeout})),i.signal&&(a=Promise.race([a,this.#$(i.signal)]));const s=await a;o(s),this.emit("completed",s)}catch(a){if(a instanceof Di&&!i.throwOnTimeout){o();return}n(a),this.emit("error",a)}finally{this.#w()}},i),this.emit("add"),this.#d()})}async addAll(t,i){return Promise.all(t.map(async o=>this.add(o,i)))}start(){return this.#l?(this.#l=!1,this.#m(),this):this}pause(){this.#l=!0}clear(){this.#t=new this.#g}async onEmpty(){this.#t.size!==0&&await this.#u("empty")}async onSizeLessThan(t){this.#t.size<t||await this.#u("next",()=>this.#t.size<t)}async onIdle(){this.#n===0&&this.#t.size===0||await this.#u("idle")}async#u(t,i){return new Promise(o=>{const n=Lt(()=>{i&&!i()||(this.off(t,n),o())},"listener");this.on(t,n)})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#l}};var ga=Object.defineProperty,va=g((e,t)=>ga(e,"name",{value:t,configurable:!0}),"r$e");const Jt=va((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 ha=Object.defineProperty,xa=g((e,t)=>ha(e,"name",{value:t,configurable:!0}),"a$r");const ya=4,ba=process.env.UV_THREADPOOL_SIZE?Number.parseInt(process.env.UV_THREADPOOL_SIZE,10):ya;let wa=class{static{g(this,"f")}static{xa(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(Jt(t,i.test))return!0;return!1}async process(t,i){this.workQueue||(this.workQueue=new fa({concurrency:ba-1}));for await(const[o,n]of this.loaders){const a={...i,options:this.options[o]??{}};if(n.alwaysProcess||Jt(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}};const ka=/data:[^\n\r;]+(?:;charset=[^\n\r;]+)?;base64,([\d+/A-Za-z]+={0,2})/;var ja=Object.defineProperty,Ye=g((e,t)=>ja(e,"name",{value:t,configurable:!0}),"i$e");const _i=/(?:\n|\r\n)?\/\*[#*@]+\s*sourceMappingURL\s*=\s*(\S+)\s*\*+\//g,Mi=/(?:\n|\r\n)?\/\/[#@]+\s*sourceMappingURL\s*=\s*(\S+)\s*?$/gm;let $a=class{static{g(this,"S")}static{Ye(this,"MapModifier")}map;constructor(t){if(typeof t=="string")try{this.map=JSON.parse(t)}catch{}else this.map=t}modify(t){return this.map?(t(this.map),this):this}modifySources(t){return this.map?(this.map.sources&&(this.map.sources=this.map.sources.map(i=>t(i))),this):this}resolve(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:S(t,i))}relative(t=process.cwd()){return this.modifySources(i=>i==="<no source>"?i:Pe(i)?_(t,i):K(i))}toObject(){return this.map}toString(){return this.map?JSON.stringify(this.map):this.map}toConsumer(){return this.map?new Zo(this.map):this.map}toCommentData(){const t=this.toString();return t?`
|
|
37
37
|
/*# sourceMappingURL=data:application/json;base64,${Buffer.from(t).toString("base64")} */`:""}toCommentFile(t){return this.map?`
|
|
38
38
|
/*# sourceMappingURL=${t} */`:""}};Ye(async(e,t)=>{const[,i]=_i.exec(e)??Mi.exec(e)??[];if(!i)return;const[,o]=ka.exec(i)??[];if(o)return Buffer.from(o,"base64").toString();if(!t)throw new Error("Extracted map detected, but no ID is provided");const n=S(T(t),i);if(z(n))return Ke(n)},"getMap");Ye(e=>e.replaceAll(_i,"").replaceAll(Mi,""),"stripMap");const ut=Ye(e=>new $a(e),"mm");var Ea=Object.defineProperty,Sa=g((e,t)=>Ea(e,"name",{value:t,configurable:!0}),"u$g");const Oa=Sa(async e=>{const t=new en({file:""}),i=[];let o=0;for await(const{css:n,map:a}of e){i.push(n);const s=ut(a),l=s.toObject();if(!l)continue;const p=s.toConsumer();if(p){if(p.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})}),l.sourcesContent)for(const r of l.sources)t.setSourceContent(r,p.sourceContentFor(r,!0));o+=n.split(`
|
|
39
39
|
`).length}}return{css:i.join(`
|
|
40
|
-
`),map:t}},"concat");var Pa=Object.defineProperty,Da=g((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"s$f");const Ti=Da(e=>e.map((t,i,o)=>{const n=`\`${t}\``;switch(i){case o.length-1:return`or ${n}`;case o.length-2:return n;default:return`${n},`}}).join(" "),"default");var Ca=Object.defineProperty,Na=g((e,t)=>Ca(e,"name",{value:t,configurable:!0}),"l$c");const _a=T(bi(import.meta.url)),Bt=Na((e,t)=>{const i={baseDirs:[_a],caller:"Resolver",extensions:[".mjs",".js",".cjs",".json"],symlinks:!0,...t},o=new sn({extensions:i.extensions,symlinks:i.symlinks});for(const n of i.baseDirs)for(const a of e)try{const{error:s,path:l}=o.sync(n,a);if(l)return l;s&&console.debug(s,{context:{basedir:n,caller:t.caller,extensions:t.extensions,id:a}})}catch(s){console.debug(s.message,{context:{basedir:n,caller:t.caller,error:s,extensions:t.extensions,id:a}})}throw new Error(`${i.caller} could not resolve ${Ti(e)}`)},"resolve");var Ma=Object.defineProperty,Ta=g((e,t)=>Ma(e,"name",{value:t,configurable:!0}),"t$c");const se={},Ia=[".js",".mjs",".cjs",".json"],Aa=Ta(async(e,t)=>{if(se[e])return se[e];if(se[e]===null)return;const i={baseDirs:[t],caller:"Module loader",extensions:Ia,symlinks:!1};try{se[e]=require(Bt([e,`./${e}`],i))}catch(o){if(o.code==="ERR_REQUIRE_ESM")try{se[e]=tn(await on(Bt([e,`./${e}`],i)))}catch{}else{se[e]=null;return}}return se[e]},"default");var za=Object.defineProperty,ge=g((e,t)=>za(e,"name",{value:t,configurable:!0}),"r$
|
|
40
|
+
`),map:t}},"concat");var Pa=Object.defineProperty,Da=g((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"s$f");const Ti=Da(e=>e.map((t,i,o)=>{const n=`\`${t}\``;switch(i){case o.length-1:return`or ${n}`;case o.length-2:return n;default:return`${n},`}}).join(" "),"default");var Ca=Object.defineProperty,Na=g((e,t)=>Ca(e,"name",{value:t,configurable:!0}),"l$c");const _a=T(bi(import.meta.url)),Bt=Na((e,t)=>{const i={baseDirs:[_a],caller:"Resolver",extensions:[".mjs",".js",".cjs",".json"],symlinks:!0,...t},o=new sn({extensions:i.extensions,symlinks:i.symlinks});for(const n of i.baseDirs)for(const a of e)try{const{error:s,path:l}=o.sync(n,a);if(l)return l;s&&console.debug(s,{context:[{basedir:n,caller:t.caller,extensions:t.extensions,id:a}]})}catch(s){console.debug(s.message,{context:[{basedir:n,caller:t.caller,error:s,extensions:t.extensions,id:a}]})}throw new Error(`${i.caller} could not resolve ${Ti(e)}`)},"resolve");var Ma=Object.defineProperty,Ta=g((e,t)=>Ma(e,"name",{value:t,configurable:!0}),"t$c");const se={},Ia=[".js",".mjs",".cjs",".json"],Aa=Ta(async(e,t)=>{if(se[e])return se[e];if(se[e]===null)return;const i={baseDirs:[t],caller:"Module loader",extensions:Ia,symlinks:!1};try{se[e]=require(Bt([e,`./${e}`],i))}catch(o){if(o.code==="ERR_REQUIRE_ESM")try{se[e]=tn(await on(Bt([e,`./${e}`],i)))}catch{}else{se[e]=null;return}}return se[e]},"default");var za=Object.defineProperty,ge=g((e,t)=>za(e,"name",{value:t,configurable:!0}),"r$d");const Ii=["inject","extract","emit"],Ra=Ti(Ii),Fa=ge(e=>{const t=Array.isArray(e)?e:[e];if(t[0]&&!Ii.includes(t[0]))throw new Error(`Incorrect mode provided, allowed modes are ${Ra}`);return{emit:t[0]==="emit",extract:t[0]==="extract"&&(t[1]??!0),inject:(!t[0]||t[0]==="inject")&&(t[1]??!0)}},"inferModeOption"),ft=ge((e,t)=>typeof e=="boolean"?e&&{}:typeof e=="object"?e:t,"inferOption"),La=ge(e=>{const t=Array.isArray(e)?e:[e];return t[0]?{content:!0,...t[1],inline:t[0]==="inline"}:!1},"inferSourceMapOption"),qt=ge((e,t)=>{const i=ft(e,{});return t&&typeof i=="object"&&!i.alias&&(i.alias=t),i},"inferHandlerOption"),ue=ge(async(e,t,i)=>{if(typeof e!="string")return e;const o=await Aa(e,i);if(!o)throw new Error(`Unable to load PostCSS ${t} \`${e}\``);return o},"ensurePCSSOption"),Ja=ge(async(e,t)=>{if(e===void 0)return[];if(e.length===0)return[];const i=[];for await(const o of e.filter(Boolean)){if(!Array.isArray(o)){i.push(await ue(o,"plugin",t));continue}const[n,a]=o;a?i.push((await ue(n,"plugin",t))(a)):i.push(await ue(n,"plugin",t))}return i},"ensurePCSSPlugins");var Ba=Object.defineProperty,be=g((e,t)=>Ba(e,"name",{value:t,configurable:!0}),"b$3");const qa=be(async(e,t)=>e.sort((i,o)=>t.indexOf(i.name)-t.indexOf(o.name)),"sortByNameOrder"),Wa=be(async(e,t,i,o,n,a,s,l,p,r)=>{const c={...r,...e.alias},m=Y(e.include,e.exclude),d=La(e.sourceMap),u={...Fa(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 y=!1;if(e.loaders)for(const x of e.loaders)x.name==="postcss"&&(y=!0);else e.loaders=[];y&&(u.postcss={...e.postcss,config:ft(e.postcss?.config,{}),import:qt(e.postcss?.import,c),modules:ft(e.postcss?.modules,void 0),to:e.postcss?.to,url:qt(e.postcss?.url,c)},e.postcss?.parser&&(u.postcss.parser=await ue(e.postcss.parser,"parser",o)),e.postcss?.syntax&&(u.postcss.syntax=await ue(e.postcss.syntax,"syntax",o)),e.postcss?.stringifier&&(u.postcss.stringifier=await ue(e.postcss.stringifier,"stringifier",o)),e.postcss?.plugins&&(u.postcss.plugins=await Ja(e.postcss.plugins,o)));const v=new wa({extensions:u.extensions,loaders:await qa(e.loaders,["sourcemap","stylus","less","sass","postcss"]),logger:t,options:{...e,...u,alias:c}});let h=[];const f=be((x,k)=>{const w=[];for(const b of Object.keys(x)){const $=new Set;let N=[b];do{const B=[];for(const R of N){if($.has(R))continue;if(v.isSupported(R)){m(R)&&B.push(R);continue}$.add(R);const ce=k(R);ce&&B.push(...ce.importedIds)}N=B}while(N.some(B=>!v.isSupported(B)));w.push(...N)}return w},"traverseImportedModules");return{augmentChunkHash(x){if(h.length===0)return null;const k=f(x.modules,this.getModuleInfo),w=h.filter(b=>k.includes(b.id)).sort((b,$)=>k.lastIndexOf(b.id)-k.lastIndexOf($.id)).map(b=>`${ne(b.id)}:${b.css}`);return w.length===0?null:w.join(":")},async generateBundle(x,k){if(h.length===0||!(x.dir||x.file))return;const w=Object.values(k),b=x.dir??T(x.file),$=w.filter(O=>O.type==="chunk"),N=$.filter(O=>!O.facadeModuleId),B=x.preserveModules?$:$.filter(O=>O.isEntry||O.isDynamicEntry),R=[],ce=be(async(O,C)=>{const E=typeof u.extract=="string"?K(u.extract).replace(/^\.[/\\]/,""):K(`${O}.css`);Pe(E)&&this.error(["Extraction path must be relative to the output directory,",`which is ${_(o,b)}`].join(`
|
|
41
41
|
`)),wt(E)&&this.error(["Extraction path must be nested inside output directory,",`which is ${_(o,b)}`].join(`
|
|
42
42
|
`));const q=h.filter(W=>C.includes(W.id)).sort((W,de)=>C.lastIndexOf(W.id)-C.lastIndexOf(de.id)),Ne=await Oa(q);return{css:Ne.css,map:ut(Ne.map.toString()).relative(T(S(b,E))).toString(),name:E}},"getExtractedData"),F=be(O=>{if(x.file)return nt(x.file).name;if(x.preserveModules){const{dir:C,name:E}=nt(O.fileName);return C?j(C,E):E}return O.name},"getName"),Q=[];if(typeof u.extract=="string"){t.debug({message:`Extracting to ${u.extract}`,prefix:"css"});const O=[];for(const E of N){const q=f(E.modules,this.getModuleInfo);Q.push(...q),O.push(...q)}for(const E of B)O.push(...f(E.modules,this.getModuleInfo).filter(q=>!Q.includes(q)));const C=F($[0]);R.push([C,O])}else{t.debug({message:"Extracting to individual files",prefix:"css"});for(const O of N){const C=f(O.modules,this.getModuleInfo);if(C.length===0)continue;Q.push(...C);const E=F(O);R.push([E,C])}for(const O of B){const C=f(O.modules,this.getModuleInfo).filter(q=>!Q.includes(q));if(C.length===0)continue;const E=F(O);R.push([E,C])}}for await(const[O,C]of R){const E=await ce(O,C);if(typeof e.onExtract=="function"&&!e.onExtract(E))continue;if(p&&e.minifier){t.info({message:`Minifying ${E.name} with ${e.minifier.name}`,prefix:"css"});const{css:W,map:de}=await e.minifier.handler.bind({browserTargets:i,warn:this.warn.bind(this)})(E,d,e[e.minifier.name]??{});E.css=W,E.map=de}const q={fileName:E.name,name:E.name,names:[E.name],originalFileName:E.name,originalFileNames:[E.name],source:E.css,type:"asset"},Ne=this.emitFile(q);if(E.map&&d){const W=this.getFileName(Ne),de=typeof x.assetFileNames=="string"?K(T(x.assetFileNames)):typeof x.assetFileNames=="function"?K(T(x.assetFileNames(q))):"assets",ve=ut(E.map).modify(M=>(M.file=ne(W),M)).modifySources(M=>{if(M==="<no source>"||de.length<=1)return M;M=`../${M}`;for(const it of de)it==="/"&&(M=`../${M}`);return M});if(d.inline)ve.modify(M=>d.transform?.(M,K(j(b,W)))),k[W].source+=ve.toCommentData();else{const M=`${W}.map`;ve.modify(mo=>d.transform?.(mo,K(j(b,M)))),this.emitFile({fileName:M,source:ve.toString(),type:"asset"});const{base:it}=nt(M);k[W].source+=ve.toCommentFile(it)}}}},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 ${_(o,k)}`),null}catch{}typeof e.onImport=="function"&&e.onImport(x,k);const w={alias:c,assets:new Map,autoModules:u.autoModules,browserTargets:i,cwd:o,debug:l,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)},b=await v.process({code:x},w);for(const $ of w.deps)this.addWatchFile($);for(const[$,N]of w.assets)this.emitFile({fileName:$,source:N,type:"asset"});if(b.extracted){const{id:$}=b.extracted;h=h.filter(N=>N.id!==$),h.push(b.extracted)}return{code:b.code,map:d&&b.map?b.map:{mappings:""},meta:{styles:b.meta},moduleSideEffects:b.extracted?!0:null}}}},"default");var Ua=Object.defineProperty,Va=g((e,t)=>Ua(e,"name",{value:t,configurable:!0}),"t$b");const Ka=/\.module\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/,rt=Va((e,t)=>e===void 0?!0:typeof e=="function"?e(t):e instanceof RegExp?e.test(t):e&&Ka.test(t),"ensureAutoModules");var Ga=Object.defineProperty,Ha=g((e,t)=>Ga(e,"name",{value:t,configurable:!0}),"u$d");const Ya=`
|
|
43
43
|
/* eslint-disable */
|
|
@@ -58,7 +58,7 @@ ${l}`),i.info({message:`Generated types for ${K(a).replace(t+"/","")}`,prefix:"d
|
|
|
58
58
|
`),e&&(o+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
|
|
59
59
|
`),t&&(o+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
|
|
60
60
|
`),i&&(o+=`const require = __cjs_mod__.createRequire(import.meta.url);
|
|
61
|
-
`),o},"generateCJSShimNode20_11"),os=Xe((e,t)=>{const i=Y(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(o,n,a){if(a.format==="es"&&i(n.fileName)){let s=ts;if(e.engines?.node){const l=xi(e.engines.node);l&&l.major>=20&&l.minor>=11&&(s=is)}return es(o,s)}return null}}},"esmShimCjsSyntaxPlugin");var ns=Object.defineProperty,as=g((e,t)=>ns(e,"name",{value:t,configurable:!0}),"m$b");const ss=as(()=>({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 rs=Object.defineProperty,ls=g((e,t)=>rs(e,"name",{value:t,configurable:!0}),"e$7");const Wt=/^([\w-]+):/,Ut=ls(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=Wt.exec(e);i&&(t.push(i[1]),e=e.replace(Wt,""));const o=e.split("/");for(const n of o)(n.includes("*")||n)&&t.push(n);return t},"splitTsconfigPathKey");var ps=Object.defineProperty,cs=g((e,t)=>ps(e,"name",{value:t,configurable:!0}),"h$2");const ds=cs((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=Ut(e),a=Ut(t);let s=n.length-1,l=a.length-1;for(;s>=0&&l>=0&&n[s]===a[l];)s--,l--;let p=n.slice(0,s).join("/");const r=a.slice(l).join("/");return(!p.startsWith(".")||p==="")&&(p="./"+p),p+(r?"/"+r:"")},"extendString");var ms=Object.defineProperty,us=g((e,t)=>ms(e,"name",{value:t,configurable:!0}),"s$e");const fs=us((...e)=>{if(e.length===0)return"";if(e.length===1)return T(e[0]);e=e.map(n=>Fe(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 l of a)if(l===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 gs=Object.defineProperty,lt=g((e,t)=>gs(e,"name",{value:t,configurable:!0}),"u$c");const vs=lt((e,t,i,o,n,a,s)=>{const l=Y(a.include,a.exclude),p={},r=lt((d,u)=>{p[d.replace(ae,"")]=u},"addOutput");let c=[];s?.config.compilerOptions&&(c=Object.entries(s.config.compilerOptions.paths??{}).map(([d])=>d.endsWith("*")?new RegExp(`^${d.replace("*","(.*)")}$`):new RegExp(`^${d}$`)));async function m(d,u){if(!l(u))return;let y;try{y=(await rn(d,{sourceFilename:u})).program}catch(x){n.debug({message:x.message,prefix:"packem:isolated-declarations"})}if(y){const x=y.body.filter(k=>(k.type==="ImportDeclaration"||k.type==="ExportAllDeclaration"||k.type==="ExportNamedDeclaration")&&!!k.source);for await(const k of x){if(ne(k.source.value).includes("."))continue;const w=await this.resolve(k.source.value,u);if(!(!w||w.external)&&(w.id.endsWith(".ts")||w.id.endsWith(".cts")||w.id.endsWith(".mts")||w.id.endsWith(".tsx")||w.id.endsWith(".ctsx")||w.id.endsWith(".mtsx"))){const b=w.id.replace(e+"/","");let $=k.source.value;c.some(N=>N.test(k.source.value))&&!k.source.value.startsWith(".")&&($="./"+k.source.value),d=d.replaceAll('from "'+k.source.value+'"','from "'+ds($,b)+'"')}}}const{errors:v,sourceText:h}=await t(u,d);if(v.length>0){if(a.ignoreErrors){this.warn(v[0]);return}return this.error(v[0])}if(r(u,h),!y)return;const f=y.body.filter(x=>x.type==="ImportDeclaration"?x.importKind==="type"?!0:x.specifiers?.every(k=>k.type==="ImportSpecifier"&&k.importKind==="type"):x.type==="ExportNamedDeclaration"||x.type==="ExportAllDeclaration"?x.exportKind==="type"?!0:x.type==="ExportNamedDeclaration"&&x.specifiers?.every(k=>k.type==="ExportSpecifier"&&k.exportKind==="type"):!1);for await(const x of f){if(!x.source)continue;const k=await this.resolve(x.source.value,u);if(!k)return;const w=k.id;if(l(w)&&!p[w.replace(ae,"")])try{const b=await Se(w);await m.call(this,b,w)}catch{}}}return g(m,"E"),lt(m,"transform"),{name:"packem:isolated-declarations",async renderStart(d,{input:u}){const y=fs(...Array.isArray(u)?u:Object.values(u));n.debug({message:"Input base:"+y,prefix:"packem:isolated-declarations"}),typeof d.entryFileNames=="function"&&(d.entryFileNames=d.entryFileNames({name:d.name}));const v=d.entryFileNames.replace(/\.(.)?[jt]sx?$/,(h,f)=>`.d.${f||""}ts`);for await(let[h,f]of Object.entries(p)){if(o&&d.format==="cjs"){const k=Si(f);k!==null&&(f=k.code)}const x=f.includes("from '")?"'":'"';(i===!0||i==="compatible")&&d.format==="cjs"&&(n.debug({message:"Emit compatible dts file: "+h,prefix:"packem:isolated-declarations"}),this.emitFile({fileName:v.replace("[name]",_(y,h)).replace(".cts",".ts"),source:f.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(k,w,b,$)=>w+x+($||b)+".d.ts"+x+";"),type:"asset"})),n.debug({message:"Emit dts file: "+h,prefix:"packem:isolated-declarations"}),this.emitFile({fileName:v.replace("[name]",_(y,h)),source:f.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(k,w,b,$)=>w+x+($||b)+(d.format==="cjs"?".d.cts":".d.mts")+x+";"),type:"asset"})}},transform:m}},"isolatedDeclarationsPlugin");var hs=Object.defineProperty,xs=g((e,t)=>hs(e,"name",{value:t,configurable:!0}),"n$9");const Vt="export default ",Ai=xs(e=>{const t=ln(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(Vt)&&(n.code=n.code.replace(Vt,"module.exports = ")),n}}},"JSONPlugin");var ys=Object.defineProperty,_e=g((e,t)=>ys(e,"name",{value:t,configurable:!0}),"i$b");class zi{static{g(this,"WalkerBase")}static{_e(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:_e(()=>this.should_skip=!0,"skip"),remove:_e(()=>this.should_remove=!0,"remove"),replace:_e(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 bs=Object.defineProperty,we=g((e,t)=>bs(e,"name",{value:t,configurable:!0}),"c$f");class ws extends zi{static{g(this,"SyncWalker")}static{we(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:we(()=>this.should_skip=!0,"skip"),remove:we(()=>this.should_remove=!0,"remove"),replace:we(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,l=this.should_remove,p=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=l,this.replacement=p,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 l=s;for(let p=0;p<l.length;p+=1){const r=l[p];gt(r)&&(this.visit(r,t,a,p)||p--)}}else gt(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=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 p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function gt(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(gt,"n$8");we(gt,"isNode");var ks=Object.defineProperty,ke=g((e,t)=>ks(e,"name",{value:t,configurable:!0}),"c$e");class js extends zi{static{g(this,"AsyncWalker")}static{ke(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ke(()=>this.should_skip=!0,"skip"),remove:ke(()=>this.should_remove=!0,"remove"),replace:ke(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,l=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,i,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=l,this.replacement=p,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 l=s;for(let p=0;p<l.length;p+=1){const r=l[p];vt(r)&&(await this.visit(r,t,a,p)||p--)}}else vt(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=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 p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function vt(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(vt,"a$l");ke(vt,"isNode");var $s=Object.defineProperty,Ri=g((e,t)=>$s(e,"name",{value:t,configurable:!0}),"a$k");function $t(e,{enter:t,leave:i}){return new ws(t,i).visit(e,null)}g($t,"walk");Ri($t,"walk");async function Es(e,{enter:t,leave:i}){return await new js(t,i).visit(e,null)}g(Es,"asyncWalk");Ri(Es,"asyncWalk");var Ss=Object.defineProperty,Os=g((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"u$a");const Ps=Os(({attributes:e,logger:t})=>{const i=Y([/\.[tj]sx$/],/node_modules/);if(!Array.isArray(e)||e.length===0)throw new Error("[packem:jsx-remove-attributes]: attributes must be a non-empty array of strings.");return{name:"packem:jsx-remove-attributes",transform(o,n){if(!i(n))return null;let a=null;try{a=this.parse(o,{allowReturnOutsideFunction:!0})}catch(p){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(p),null}let s=!1;const l=new H(o);return $t(a,{enter(p){if(p.type==="CallExpression"&&p.callee.type==="Identifier"&&p.callee.name==="jsx"){const r=p.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)&&(l.overwrite(m.start-2,m.end,""),s=!0)}}}),s?{code:l.toString(),map:l.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var Ds=Object.defineProperty,Cs=g((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"r$c");const Ns=Cs((e,t,i)=>{const o=new RegExp(`(<!-- ${t} -->)[\\s\\S]*?(<!-- /${t} -->)`,"g");if(o.test(e))return e.replace(o,`$1
|
|
61
|
+
`),o},"generateCJSShimNode20_11"),os=Xe((e,t)=>{const i=Y(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(o,n,a){if(a.format==="es"&&i(n.fileName)){let s=ts;if(e.engines?.node){const l=xi(e.engines.node);l&&l.major>=20&&l.minor>=11&&(s=is)}return es(o,s)}return null}}},"esmShimCjsSyntaxPlugin");var ns=Object.defineProperty,as=g((e,t)=>ns(e,"name",{value:t,configurable:!0}),"m$b");const ss=as(()=>({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 rs=Object.defineProperty,ls=g((e,t)=>rs(e,"name",{value:t,configurable:!0}),"e$8");const Wt=/^([\w-]+):/,Ut=ls(e=>{if(!e||typeof e!="string")throw new Error("Invalid key: Key must be a non-empty string.");const t=[],i=Wt.exec(e);i&&(t.push(i[1]),e=e.replace(Wt,""));const o=e.split("/");for(const n of o)(n.includes("*")||n)&&t.push(n);return t},"splitTsconfigPathKey");var ps=Object.defineProperty,cs=g((e,t)=>ps(e,"name",{value:t,configurable:!0}),"h$2");const ds=cs((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=Ut(e),a=Ut(t);let s=n.length-1,l=a.length-1;for(;s>=0&&l>=0&&n[s]===a[l];)s--,l--;let p=n.slice(0,s).join("/");const r=a.slice(l).join("/");return(!p.startsWith(".")||p==="")&&(p="./"+p),p+(r?"/"+r:"")},"extendString");var ms=Object.defineProperty,us=g((e,t)=>ms(e,"name",{value:t,configurable:!0}),"s$e");const fs=us((...e)=>{if(e.length===0)return"";if(e.length===1)return T(e[0]);e=e.map(n=>Fe(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 l of a)if(l===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 gs=Object.defineProperty,lt=g((e,t)=>gs(e,"name",{value:t,configurable:!0}),"u$c");const vs=lt((e,t,i,o,n,a,s)=>{const l=Y(a.include,a.exclude),p={},r=lt((d,u)=>{p[d.replace(ae,"")]=u},"addOutput");let c=[];s?.config.compilerOptions&&(c=Object.entries(s.config.compilerOptions.paths??{}).map(([d])=>d.endsWith("*")?new RegExp(`^${d.replace("*","(.*)")}$`):new RegExp(`^${d}$`)));async function m(d,u){if(!l(u))return;let y;try{y=(await rn(d,{sourceFilename:u})).program}catch(x){n.debug({message:x.message,prefix:"packem:isolated-declarations"})}if(y){const x=y.body.filter(k=>(k.type==="ImportDeclaration"||k.type==="ExportAllDeclaration"||k.type==="ExportNamedDeclaration")&&!!k.source);for await(const k of x){if(ne(k.source.value).includes("."))continue;const w=await this.resolve(k.source.value,u);if(!(!w||w.external)&&(w.id.endsWith(".ts")||w.id.endsWith(".cts")||w.id.endsWith(".mts")||w.id.endsWith(".tsx")||w.id.endsWith(".ctsx")||w.id.endsWith(".mtsx"))){const b=w.id.replace(e+"/","");let $=k.source.value;c.some(N=>N.test(k.source.value))&&!k.source.value.startsWith(".")&&($="./"+k.source.value),d=d.replaceAll('from "'+k.source.value+'"','from "'+ds($,b)+'"')}}}const{errors:v,sourceText:h}=await t(u,d);if(v.length>0){if(a.ignoreErrors){this.warn(v[0]);return}return this.error(v[0])}if(r(u,h),!y)return;const f=y.body.filter(x=>x.type==="ImportDeclaration"?x.importKind==="type"?!0:x.specifiers?.every(k=>k.type==="ImportSpecifier"&&k.importKind==="type"):x.type==="ExportNamedDeclaration"||x.type==="ExportAllDeclaration"?x.exportKind==="type"?!0:x.type==="ExportNamedDeclaration"&&x.specifiers?.every(k=>k.type==="ExportSpecifier"&&k.exportKind==="type"):!1);for await(const x of f){if(!x.source)continue;const k=await this.resolve(x.source.value,u);if(!k)return;const w=k.id;if(l(w)&&!p[w.replace(ae,"")])try{const b=await Se(w);await m.call(this,b,w)}catch{}}}return g(m,"E"),lt(m,"transform"),{name:"packem:isolated-declarations",async renderStart(d,{input:u}){const y=fs(...Array.isArray(u)?u:Object.values(u));n.debug({message:"Input base:"+y,prefix:"packem:isolated-declarations"}),typeof d.entryFileNames=="function"&&(d.entryFileNames=d.entryFileNames({name:d.name}));const v=d.entryFileNames.replace(/\.(.)?[jt]sx?$/,(h,f)=>`.d.${f||""}ts`);for await(let[h,f]of Object.entries(p)){if(o&&d.format==="cjs"){const k=Si(f);k!==null&&(f=k.code)}const x=f.includes("from '")?"'":'"';(i===!0||i==="compatible")&&d.format==="cjs"&&(n.debug({message:"Emit compatible dts file: "+h,prefix:"packem:isolated-declarations"}),this.emitFile({fileName:v.replace("[name]",_(y,h)).replace(".cts",".ts"),source:f.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(k,w,b,$)=>w+x+($||b)+".d.ts"+x+";"),type:"asset"})),n.debug({message:"Emit dts file: "+h,prefix:"packem:isolated-declarations"}),this.emitFile({fileName:v.replace("[name]",_(y,h)),source:f.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(k,w,b,$)=>w+x+($||b)+(d.format==="cjs"?".d.cts":".d.mts")+x+";"),type:"asset"})}},transform:m}},"isolatedDeclarationsPlugin");var hs=Object.defineProperty,xs=g((e,t)=>hs(e,"name",{value:t,configurable:!0}),"n$9");const Vt="export default ",Ai=xs(e=>{const t=ln(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(Vt)&&(n.code=n.code.replace(Vt,"module.exports = ")),n}}},"JSONPlugin");var ys=Object.defineProperty,_e=g((e,t)=>ys(e,"name",{value:t,configurable:!0}),"i$b");class zi{static{g(this,"WalkerBase")}static{_e(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:_e(()=>this.should_skip=!0,"skip"),remove:_e(()=>this.should_remove=!0,"remove"),replace:_e(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 bs=Object.defineProperty,we=g((e,t)=>bs(e,"name",{value:t,configurable:!0}),"c$f");class ws extends zi{static{g(this,"SyncWalker")}static{we(this,"SyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:we(()=>this.should_skip=!0,"skip"),remove:we(()=>this.should_remove=!0,"remove"),replace:we(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,l=this.should_remove,p=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=l,this.replacement=p,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 l=s;for(let p=0;p<l.length;p+=1){const r=l[p];gt(r)&&(this.visit(r,t,a,p)||p--)}}else gt(s)&&this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=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 p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function gt(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(gt,"n$8");we(gt,"isNode");var ks=Object.defineProperty,ke=g((e,t)=>ks(e,"name",{value:t,configurable:!0}),"c$e");class js extends zi{static{g(this,"AsyncWalker")}static{ke(this,"AsyncWalker")}constructor(t,i){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ke(()=>this.should_skip=!0,"skip"),remove:ke(()=>this.should_remove=!0,"remove"),replace:ke(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,l=this.should_remove,p=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,i,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=l,this.replacement=p,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 l=s;for(let p=0;p<l.length;p+=1){const r=l[p];vt(r)&&(await this.visit(r,t,a,p)||p--)}}else vt(s)&&await this.visit(s,t,a,null)}if(this.leave){const s=this.replacement,l=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 p=this.should_remove;if(this.replacement=s,this.should_remove=l,p)return null}}return t}}function vt(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(vt,"a$l");ke(vt,"isNode");var $s=Object.defineProperty,Ri=g((e,t)=>$s(e,"name",{value:t,configurable:!0}),"a$k");function $t(e,{enter:t,leave:i}){return new ws(t,i).visit(e,null)}g($t,"walk");Ri($t,"walk");async function Es(e,{enter:t,leave:i}){return await new js(t,i).visit(e,null)}g(Es,"asyncWalk");Ri(Es,"asyncWalk");var Ss=Object.defineProperty,Os=g((e,t)=>Ss(e,"name",{value:t,configurable:!0}),"u$a");const Ps=Os(({attributes:e,logger:t})=>{const i=Y([/\.[tj]sx$/],/node_modules/);if(!Array.isArray(e)||e.length===0)throw new Error("[packem:jsx-remove-attributes]: attributes must be a non-empty array of strings.");return{name:"packem:jsx-remove-attributes",transform(o,n){if(!i(n))return null;let a=null;try{a=this.parse(o,{allowReturnOutsideFunction:!0})}catch(p){return this.warn({code:"PARSE_ERROR",message:`[packem:jsx-remove-attributes]: failed to parse "${n}" and remove the jsx attribute.`}),t.warn(p),null}let s=!1;const l=new H(o);return $t(a,{enter(p){if(p.type==="CallExpression"&&p.callee.type==="Identifier"&&p.callee.name==="jsx"){const r=p.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)&&(l.overwrite(m.start-2,m.end,""),s=!0)}}}),s?{code:l.toString(),map:l.generateMap({hires:!0})}:null}}},"jsxRemoveAttributes");var Ds=Object.defineProperty,Cs=g((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"r$b");const Ns=Cs((e,t,i)=>{const o=new RegExp(`(<!-- ${t} -->)[\\s\\S]*?(<!-- /${t} -->)`,"g");if(o.test(e))return e.replace(o,`$1
|
|
62
62
|
${i}
|
|
63
63
|
$2`)},"replaceContentWithin");var _s=Object.defineProperty,Fi=g((e,t)=>_s(e,"name",{value:t,configurable:!0}),"d$b");const Ms=Fi(e=>{const t=[],i=[];return e.forEach(o=>{o.startsWith("(")?t.push(o):i.push(o)}),[...i.sort(),...t.sort()]},"sortLicenses"),Li=Fi(({dtsMarker:e,licenseFilePath:t,licenseTemplate:i,logger:o,marker:n,mode:a,packageName:s})=>pn({thirdParty(l){const p=new Set,r=l.sort(({name:m},{name:d})=>(m||0)>(d||0)?1:(d||0)>(m||0)?-1:0).map(({author:m,contributors:d,license:u,licenseText:y,maintainers:v,name:h,repository:f})=>{let x="## "+h+`
|
|
64
64
|
`;u&&(x+=`License: ${u}
|
|
@@ -78,15 +78,15 @@ ${JSON.stringify({typesVersions:{"*":s}},null,4)}
|
|
|
78
78
|
`,prefix:"plugin:node10-compatibility"})}}},"node10CompatibilityPlugin");var Ls=Object.defineProperty,Js=g((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"t$8");const te=Js(e=>dn("sha256").update(e).digest("hex"),"getHash");var Bs=Object.defineProperty,Ji=g((e,t)=>Bs(e,"name",{value:t,configurable:!0}),"d$a");const ye=Ji(e=>e.handler||e,"getHandler"),I=Ji((e,t,i="")=>({...e,async buildEnd(o){e.buildEnd&&await ye(e.buildEnd).call(this,o)},async buildStart(o){e.buildStart&&await ye(e.buildStart).call(this,o)},async load(o){if(!e.load)return null;const n=j(i,e.name),a=j("load",te(o));if(t.has(a,n))return await t.get(a,n);const s=await ye(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=j(i,e.name),l=j("resolveId",te(o),n?te(n):"",te(JSON.stringify(a)));if(t.has(l,s))return await t.get(l,s);const p=await ye(e.resolveId).call(this,o,n,a);return t.set(l,p,s),p},async transform(o,n){if(!e.transform)return null;const a=j(i,e.name),s=j("transform",te(n),te(o));if(t.has(s,a))return await t.get(s,a);const l=await ye(e.transform).call(this,o,n);return t.set(s,l,a),l}}),"cachingPlugin");var qs=Object.defineProperty,Ws=g((e,t)=>qs(e,"name",{value:t,configurable:!0}),"c$b");const Us=Ws(({directiveRegex:e,exclude:t=[],include:i=[],logger:o})=>{const n={},a={},s=Y(i,t);return{name:"packem:preserve-directives",onLog(l,p){return p.code==="MODULE_LEVEL_DIRECTIVE"&&l==="warn"?!1:null},renderChunk:{handler(l,p,{sourcemap:r}){const c=p.moduleIds.map(u=>n[u]?n[u]:null).reduce((u,y)=>(y&&y.forEach(v=>{u.add(v)}),u),new Set),m=new H(l);c.size>0&&(o.debug({message:`directives for chunk "${p.fileName}" are preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${[...c].map(u=>`'${u}';`).join(`
|
|
79
79
|
`)}
|
|
80
80
|
`));let d;return p.facadeModuleId&&typeof a[p.facadeModuleId]=="string"&&(d=a[p.facadeModuleId]),d&&(o.debug({message:`shebang for chunk "${p.fileName}" is preserved.`,prefix:"plugin:preserve-directives"}),m.prepend(`${d}
|
|
81
|
-
`)),c.size===0&&d===void 0?null:{code:m.toString(),map:r?m.generateMap({hires:!0}):null}},order:"post"},transform(l,p){if(!s(p))return null;let r=!1;const c=new H(l);if(l.startsWith("#")&&l[1]==="!"){let d=0;for(let u=2,y=l.length;u<y;u++){const v=l.codePointAt(u);if(v===10||v===13||v===8232||v===8233){d=u;break}}d&&(a[p]=l.slice(0,d),c.remove(0,d+1),r=!0,o.debug({message:`shebang for module "${p}" 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 "${p}" 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[p]||=new Set,n[p].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 "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return r?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var Vs=Object.defineProperty,Ks=g((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"n$7");const Gs=Ks(e=>{const t=Y(e.include,e.exclude);return{async load(i){return i.includes("?raw")?await this.load({id:i.replace(/\?raw$/,"")}):null},name:"packem:raw",transform(i,o){return!t(o)&&!o.includes("?raw")?null:(o.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var Hs=Object.defineProperty,Ys=g((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"i$9");const Qe=Ys((e,t)=>{let i={};return e.name&&(i[e.name]=t.rootDir),i={...i,...t.alias},t.rollup.alias&&(Array.isArray(t.rollup.alias.entries)?Object.assign(i,Object.fromEntries(t.rollup.alias.entries.map(o=>[o.find,o.replacement]))):Object.assign(i,t.rollup.alias.entries??t.rollup.alias)),i},"resolveAliases");var Xs=Object.defineProperty,je=g((e,t)=>Xs(e,"name",{value:t,configurable:!0}),"a$h");const Gt=je((e,t,i)=>e.reduce((o,n,a)=>(n instanceof RegExp?o.push(n):typeof n=="string"&&n.length>0?o.push(new RegExp("^"+n.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$")):i.warn(`Ignoring wrong entry type #${a} in '${t}' option: ${JSON.stringify(n)}`),o),[]),"getRegExps"),Ht=new Map,Bi=je((e,t,i,o,n)=>{const a=new Map,s=new Map,l=new Set(Gt([...i.externals],"include",o)),p=new Set(Gt([...n.exclude??[]],"exclude",o)),r={};Object.assign(r,n.deps?e.dependencies:void 0,n.devDeps?e.devDependencies:void 0,n.peerDeps?e.peerDependencies:void 0,n.optDeps?e.optionalDependencies:void 0);const c=Object.keys(r);if(c.length>0&&l.add(new RegExp("^(?:"+c.join("|")+")(?:/.+)?$")),e.peerDependenciesMeta)for(const[v,h]of Object.entries(e.peerDependenciesMeta))h?.optional&&l.add(new RegExp(`^${v}(?:/.+)?$`));const m=je(v=>[...l].some(h=>h.test(v)),"isIncluded"),d=je(v=>[...p].some(h=>h.test(v)),"isExcluded");let u=[];t&&(u=Object.entries(t.config.compilerOptions?.paths??{}).map(([v])=>v.endsWith("*")?new RegExp(`^${v.replace("*","(.*)")}$`):new RegExp(`^${v}$`)));const y=Qe(e,i);return{name:"packem:resolve-externals",options:je(v=>{v.external=(h,f)=>{if(s.has(h))return s.get(h);if(Object.keys(y).length>0&&(h=Qo(h,y)),/^(?:\0|\.{1,2}\/)/.test(h)||Pe(h)||e.name&&h.startsWith(e.name))return s.set(h,!1),!1;if(at(h)){let x=n.builtins;return x===void 0&&f&&(x=m(f)&&!d(f)),s.set(h,x),x}if(m(h)&&!d(h))return s.set(h,!0),!0;if(e.imports)for(const[x,k]of Object.entries(e.imports)){if(x===h)return s.set(h,!1),!1;if(x.includes("*")){let w;a.has(x)?w=a.get(x):(w=mn(j(i.rootDir,k.replace("/*","")),{withFileTypes:!0}).filter(b=>b.isFile()).map(b=>b.name),a.set(x,w));for(const b of w)if(b.replace(ae,"")===h.replace(ae,"").replace("#",""))return s.set(h,!1),!1}}if(u.length>0){for(const x of u)if(x.test(h))return s.set(h,!1),!1}return Ht.has(h)||o.info({message:'Inlined implicit external "'+D(h)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),Ht.set(h,!0),!1}},"options"),resolveId:{async handler(v,h,{isEntry:f}){if(f)return null;if(at(v)){const x=v.replace(/^node:/,"");return{external:(n.builtins||m(v))&&!d(v),id:n.builtinsPrefix==="ignore"?v:n.builtinsPrefix==="add"||!at(x)?"node:"+x:x,moduleSideEffects:!1}}return null},order:"pre"}}},"resolveExternalsPlugin");var Qs=Object.defineProperty,Zs=g((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"r$
|
|
81
|
+
`)),c.size===0&&d===void 0?null:{code:m.toString(),map:r?m.generateMap({hires:!0}):null}},order:"post"},transform(l,p){if(!s(p))return null;let r=!1;const c=new H(l);if(l.startsWith("#")&&l[1]==="!"){let d=0;for(let u=2,y=l.length;u<y;u++){const v=l.codePointAt(u);if(v===10||v===13||v===8232||v===8233){d=u;break}}d&&(a[p]=l.slice(0,d),c.remove(0,d+1),r=!0,o.debug({message:`shebang for module "${p}" 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 "${p}" 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[p]||=new Set,n[p].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 "${p}" is preserved.`,prefix:"plugin:preserve-directives"}))}return r?{code:c.toString(),map:c.generateMap({hires:!0}),meta:{preserveDirectives:{directives:[...n[p]??[]],shebang:a[p]??null}}}:null}}},"preserveDirectives");var Vs=Object.defineProperty,Ks=g((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"n$7");const Gs=Ks(e=>{const t=Y(e.include,e.exclude);return{async load(i){return i.includes("?raw")?await this.load({id:i.replace(/\?raw$/,"")}):null},name:"packem:raw",transform(i,o){return!t(o)&&!o.includes("?raw")?null:(o.includes("?raw")||(i=`export default ${JSON.stringify(i)}`),{code:i,map:{mappings:""}})}}},"rawPlugin");var Hs=Object.defineProperty,Ys=g((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"i$9");const Qe=Ys((e,t)=>{let i={};return e.name&&(i[e.name]=t.rootDir),i={...i,...t.alias},t.rollup.alias&&(Array.isArray(t.rollup.alias.entries)?Object.assign(i,Object.fromEntries(t.rollup.alias.entries.map(o=>[o.find,o.replacement]))):Object.assign(i,t.rollup.alias.entries??t.rollup.alias)),i},"resolveAliases");var Xs=Object.defineProperty,je=g((e,t)=>Xs(e,"name",{value:t,configurable:!0}),"a$h");const Gt=je((e,t,i)=>e.reduce((o,n,a)=>(n instanceof RegExp?o.push(n):typeof n=="string"&&n.length>0?o.push(new RegExp("^"+n.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$")):i.warn(`Ignoring wrong entry type #${a} in '${t}' option: ${JSON.stringify(n)}`),o),[]),"getRegExps"),Ht=new Map,Bi=je((e,t,i,o,n)=>{const a=new Map,s=new Map,l=new Set(Gt([...i.externals],"include",o)),p=new Set(Gt([...n.exclude??[]],"exclude",o)),r={};Object.assign(r,n.deps?e.dependencies:void 0,n.devDeps?e.devDependencies:void 0,n.peerDeps?e.peerDependencies:void 0,n.optDeps?e.optionalDependencies:void 0);const c=Object.keys(r);if(c.length>0&&l.add(new RegExp("^(?:"+c.join("|")+")(?:/.+)?$")),e.peerDependenciesMeta)for(const[v,h]of Object.entries(e.peerDependenciesMeta))h?.optional&&l.add(new RegExp(`^${v}(?:/.+)?$`));const m=je(v=>[...l].some(h=>h.test(v)),"isIncluded"),d=je(v=>[...p].some(h=>h.test(v)),"isExcluded");let u=[];t&&(u=Object.entries(t.config.compilerOptions?.paths??{}).map(([v])=>v.endsWith("*")?new RegExp(`^${v.replace("*","(.*)")}$`):new RegExp(`^${v}$`)));const y=Qe(e,i);return{name:"packem:resolve-externals",options:je(v=>{v.external=(h,f)=>{if(s.has(h))return s.get(h);if(Object.keys(y).length>0&&(h=Qo(h,y)),/^(?:\0|\.{1,2}\/)/.test(h)||Pe(h)||e.name&&h.startsWith(e.name))return s.set(h,!1),!1;if(at(h)){let x=n.builtins;return x===void 0&&f&&(x=m(f)&&!d(f)),s.set(h,x),x}if(m(h)&&!d(h))return s.set(h,!0),!0;if(e.imports)for(const[x,k]of Object.entries(e.imports)){if(x===h)return s.set(h,!1),!1;if(x.includes("*")){let w;a.has(x)?w=a.get(x):(w=mn(j(i.rootDir,k.replace("/*","")),{withFileTypes:!0}).filter(b=>b.isFile()).map(b=>b.name),a.set(x,w));for(const b of w)if(b.replace(ae,"")===h.replace(ae,"").replace("#",""))return s.set(h,!1),!1}}if(u.length>0){for(const x of u)if(x.test(h))return s.set(h,!1),!1}return Ht.has(h)||o.info({message:'Inlined implicit external "'+D(h)+'". If this is incorrect, add it to the "externals" option.',prefix:"plugin:packem:resolve-externals"}),Ht.set(h,!0),!1}},"options"),resolveId:{async handler(v,h,{isEntry:f}){if(f)return null;if(at(v)){const x=v.replace(/^node:/,"");return{external:(n.builtins||m(v))&&!d(v),id:n.builtinsPrefix==="ignore"?v:n.builtinsPrefix==="add"||!at(x)?"node:"+x:x,moduleSideEffects:!1}}return null},order:"pre"}}},"resolveExternalsPlugin");var Qs=Object.defineProperty,Zs=g((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"r$a");const qi=Zs(()=>({name:"packem:resolve-file-url",resolveId(e){if(e.startsWith("file://"))return bi(e)}}),"resolveFileUrl");var er=Object.defineProperty,Ze=g((e,t)=>er(e,"name",{value:t,configurable:!0}),"i$7");const Be=/^#![^\n]*/,ht=Ze(async e=>{await zo(e,493).catch(()=>{})},"makeExecutable"),tr=Ze((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(Be,t.shebang+`
|
|
82
82
|
`);if(a)return null;if(e.includes(o.name)){const s=new H(i);return s.prepend(t.shebang+`
|
|
83
83
|
`),{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"&&Be.test(a.code)&&i.dir){const s=S(i.dir,n);await ht(s)}}}),"shebangPlugin"),ir=Ze(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(Be,"")}}),"removeShebangPlugin"),or=Ze((e,t=`
|
|
84
|
-
`)=>{const i=Be.exec(e);return i?i+t:""},"getShebang");var nr=Object.defineProperty,ar=g((e,t)=>nr(e,"name",{value:t,configurable:!0}),"l$7");const sr=ar(({exclude:e,include:t}={})=>{const i=Y(t,e);return{async load(o){if(!i(o))return null;let n;try{n=await Se(o,{buffer:!1}),this.addWatchFile(o)}catch{try{const s=o.replace(/\?.*$/,"");n=await Se(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=vn(o);if(s===void 0)return n;a=s}catch{return this.warn("Failed resolving source map"),{code:n}}return{code:n,map:a}},name:"packem:sourcemaps"}},"sourcemapsPlugin");var rr=Object.defineProperty,pe=g((e,t)=>rr(e,"name",{value:t,configurable:!0}),"r$
|
|
84
|
+
`)=>{const i=Be.exec(e);return i?i+t:""},"getShebang");var nr=Object.defineProperty,ar=g((e,t)=>nr(e,"name",{value:t,configurable:!0}),"l$7");const sr=ar(({exclude:e,include:t}={})=>{const i=Y(t,e);return{async load(o){if(!i(o))return null;let n;try{n=await Se(o,{buffer:!1}),this.addWatchFile(o)}catch{try{const s=o.replace(/\?.*$/,"");n=await Se(s,{buffer:!1}),this.addWatchFile(s)}catch{return this.warn("Failed reading file"),null}}let a;try{const s=vn(o);if(s===void 0)return n;a=s}catch{return this.warn("Failed resolving source map"),{code:n}}return{code:n,map:a}},name:"packem:sourcemaps"}},"sourcemapsPlugin");var rr=Object.defineProperty,pe=g((e,t)=>rr(e,"name",{value:t,configurable:!0}),"r$9");const lr=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,pr=/MIT License|MIT license|BSD license/,cr=/\n{2,}/g,dr=/\b(\w+)\$\d+\b/g,mr=/[-/\\^$*+?.()|[\]{}]/g,ur=pe(e=>e.replaceAll(mr,"\\$&"),"escapeRegex"),fr=pe(e=>[...new Set(e)],"unique"),gr=pe(e=>e.replaceAll(lr,t=>pr.test(t)?"":t).replaceAll(cr,`
|
|
85
85
|
|
|
86
86
|
`),"cleanUnnecessaryComments"),Yt=new Map;function Wi(e,t,{identifierReplacements:i},o){const n=yi(e);for(const s in i){const l=n.find(r=>r.specifier===s&&r.imports.includes("{"));if(!l){this.warn(`${t.fileName} does not import "${s}" for replacement`),process.exitCode=1;continue}const p=i[s];for(const r in p){if(!l.imports.includes(r))throw new Error(`${t.fileName} does not import "${r}" from "${s}" for replacement`);const c=p[r],m=ur(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=fr(Array.from(e.matchAll(dr),s=>s[0]));if(a.length>0){const s=a.map(p=>`
|
|
87
87
|
- ${p}`).join(""),l=t.fileName.replace(/\.[^/.]+$/,"");Yt.has(l)||o.warn({message:`${t.fileName} contains confusing identifier names${s}
|
|
88
88
|
|
|
89
|
-
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Yt.set(l,!0)}return e}g(Wi,"I$2");pe(Wi,"replaceConfusingTypeNames");const vr=pe((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 Ui(e,t){if(e.includes("@internal")){const i=new H(e),o=hn(e,{plugins:["typescript"],sourceType:"module"});if($t(o,{enter(n){vr(i,n)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}g(Ui,"S$3");pe(Ui,"stripInternalTypes");const hr=pe((e,t)=>({name:"packem:patch-types",renderChunk(i,o){return i=Wi.call(this,i,o,e,t),i=Ui.call(this,i,o),i=gr(i),i},resolveId(i){return i.startsWith("types/")?{external:!0,id:"../../"+(i.endsWith(".js")?i:i+".js")}:null}}),"patchTypescriptTypes");var xr=Object.defineProperty,X=g((e,t)=>xr(e,"name",{value:t,configurable:!0}),"a$g");const yr=42,br=X(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===yr){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),wr=X(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),kr=X(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),jr=X((e,t,i)=>{let o,n=-1;for(const a of e){const s=t(a);kr(s,i)&&s.prefix.length>n&&(n=s.prefix.length,o=a)}return o},"findBestPatternMatch"),$r=X((e,t)=>{const i=[];for(const o of e){if(!br(o))continue;const n=wr(o);if(n)i.push(n);else if(o===t)return o}return jr(i,o=>o,t)},"matchPatternOrExact"),Er=X((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),Sr=X(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),Or=X((e,t,i)=>{let o=T(t.path);t.config.compilerOptions?.baseUrl&&(o=S(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const n=t.config.compilerOptions?.paths??{};return Object.keys(n).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:n,resolvedBaseUrl:o}},"getTsconfigPaths"),Vi=X((e,t,i,o)=>{const{paths:n,resolvedBaseUrl:a}=Or(e,t,i),s=Object.keys(n);return{name:"packem:resolve-tsconfig-paths",async resolveId(l,p,r){if(s.length===0)return null;if(l.includes("\0"))return i.debug({message:`Skipping resolution of ${l} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(l.includes("node_modules"))return i.debug({message:`Skipping request as it is inside node_modules ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(!o.resolveAbsolutePath&&Pe(l))return i.debug({message:`Skipping request as it is an absolute path ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(wt(l))return i.debug({message:`Skipping request as it is a relative path ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=$r(s,l);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const m=typeof c=="string"?void 0:Er(c,l),d=typeof c=="string"?c:Sr(c);for await(const u of n[d]){const y=m?u.replace("*",m):u;if(y.endsWith(".d.ts")||y.endsWith(".d.cts")||y.endsWith(".d.mts"))continue;const v=j(a,y);try{const h=await this.resolve(v,p,{skipSelf:!0,...r});if(h)return h}catch(h){i.debug({context:h,message:`Failed to resolve ${v} from ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var Pr=Object.defineProperty,Ki=g((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"u$7");const Dr=Ki((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(S(e,s))}return a},"getRootDirectories"),Gi=Ki((e,t,i)=>{const o=Dr(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 l of o){const p=j(l,n),r=await this.resolve(p,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 Cr=Object.defineProperty,Nr=g((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"r$9");const Hi=Nr(()=>{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"),Yi={"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(Yi);const Xi={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(Xi);var _r=Object.defineProperty,Mr=g((e,t)=>_r(e,"name",{value:t,configurable:!0}),"g$6"),L=g(function(e,t,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(e):o?o.value:t.get(e)},"n$5"),me,$e,re;let Tr=class{static{g(this,"p")}static{Mr(this,"Mime")}constructor(...t){me.set(this,new Map),$e.set(this,new Map),re.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[o,n]of Object.entries(t)){o=o.toLowerCase(),n=n.map(l=>l.toLowerCase()),L(this,re,"f").has(o)||L(this,re,"f").set(o,new Set);const a=L(this,re,"f").get(o);let s=!0;for(let l of n){const p=l.startsWith("*");if(l=p?l.slice(1):l,a?.add(l),s&&L(this,$e,"f").set(o,l),s=!1,p)continue;const r=L(this,me,"f").get(l);if(r&&r!=o&&!i)throw new Error(`"${o} -> ${l}" conflicts with "${r} -> ${l}". Pass \`force=true\` to override this definition.`);L(this,me,"f").set(l,o)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),o=i.replace(/^.*\./,"").toLowerCase(),n=i.length<t.length;return!(o.length<i.length-1)&&n?null:L(this,me,"f").get(o)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&L(this,$e,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:L(this,re,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of L(this,re,"f").values())Object.freeze(t);return this}_getTestState(){return{types:L(this,me,"f"),extensions:L(this,$e,"f")}}};me=new WeakMap,$e=new WeakMap,re=new WeakMap;const Ir=new Tr(Xi,Yi)._freeze();var Ar=Object.defineProperty,Et=g((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"u$6");const zr=Et(async(e,t)=>{await new Promise((i,o)=>{const n=un(e);n.on("error",o);const a=fn(t);a.on("error",o),a.on("finish",i),n.pipe(a)})},"copy"),Rr=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"),Fr=Et(({destDir:e,emitFiles:t,exclude:i,fileName:o,include:n,limit:a,publicPath:s,sourceDir:l})=>{const p=Y(n,i),r={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??T(c.file??"");await Dt(m),await Promise.all(Object.keys(r).map(async d=>{const u=r[d],y=j(m,T(u));await Dt(y),await zr(d,j(m,u))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([bt(c),Ro(c)]);let u;if(a&&m.size>a||a===0){const y=cn.createHash("sha1").update(d).digest("hex").slice(0,16),v=Ge(c),h=ne(c,v),f=l?_(l,T(c)):ne(T(c)),x=o.replaceAll("[hash]",y).replaceAll("[extname]",v).replaceAll("[dirname]",f===""?"":`${f}/`).replaceAll("[name]",h);u=j(s??"",x),r[c]=x}else{const y=Ir.getType(c);if(y===null)throw new Error(`Could not determine mimetype for ${c}`);const v=y==="image/svg+xml";u=v?Rr(d):d.toString("base64"),u=`data:${y}${v?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var Lr=Object.defineProperty,Jr=g((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"s$8");const Br=Jr(e=>{const t=ne(e).split(".");if(t.length>=2){const[i,o]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(He.includes(o)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var qr=Object.defineProperty,Wr=g((e,t)=>qr(e,"name",{value:t,configurable:!0}),"i$5");const pt=Wr(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var Ur=Object.defineProperty,Xt=g((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"d$9");const Vr=Xt((e,t)=>{const i=new Map;return Xt(function(o,n){const a=n.getModuleInfo(o);if(!a)return;const{isEntry:s}=a,l=a.meta,p=pt(l);if(!s){const r=i.get(o);if(r)return r;const c=Br(o);if(c)return i.set(o,c),c}if(s){const r=n.getModuleIds();for(const c of r)n.getModuleInfo(c)&&pt(l)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([o,p]))}if(p&&!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 pt(d?d.meta:{})===p}return!1}))return;if(r.every(([,m])=>m===p))return i.has(o)?i.get(o):void 0;const c=ne(o,Ge(o))+"-"+p;return i.set(o,c),c}},"splitChunks")},"createSplitChunks");var Kr=Object.defineProperty,Gr=g((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"n$4");const oe=Gr((e,t)=>e.isDynamicEntry?`${Pn}/[name].${t}`:`${Dn}/${e.name}-[hash].${t}`,"getChunkFilename");var Hr=Object.defineProperty,Yr=g((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"o$4");const Xr=process.platform==="win32",Qt=Yr((e,t)=>{const i=Xr?"\\":"/";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 Qr=Object.defineProperty,A=g((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"e$5");const Qi=A((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"),Zr=A((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"+vo.node.split(".")[0];if(t.pkg.engines?.node){const o=xi(t.pkg.engines.node);o&&(i="node"+o.major)}if(t.options.rollup.esbuild.target){const o=Ee(t.options.rollup.esbuild.target);o.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...Ee(i),...o])])}else t.options.rollup.esbuild.target=Ee(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"),Zi=A((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(_(S(),e.id))}"
|
|
89
|
+
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Yt.set(l,!0)}return e}g(Wi,"I$2");pe(Wi,"replaceConfusingTypeNames");const vr=pe((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 Ui(e,t){if(e.includes("@internal")){const i=new H(e),o=hn(e,{plugins:["typescript"],sourceType:"module"});if($t(o,{enter(n){vr(i,n)&&this.skip()}}),e=i.toString(),e.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`)}return e}g(Ui,"S$3");pe(Ui,"stripInternalTypes");const hr=pe((e,t)=>({name:"packem:patch-types",renderChunk(i,o){return i=Wi.call(this,i,o,e,t),i=Ui.call(this,i,o),i=gr(i),i},resolveId(i){return i.startsWith("types/")?{external:!0,id:"../../"+(i.endsWith(".js")?i:i+".js")}:null}}),"patchTypescriptTypes");var xr=Object.defineProperty,X=g((e,t)=>xr(e,"name",{value:t,configurable:!0}),"a$g");const yr=42,br=X(e=>{let t=!1;for(let i=0;i<e.length;i++)if(e.codePointAt(i)===yr){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),wr=X(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),kr=X(({prefix:e,suffix:t},i)=>i.length>=e.length+t.length&&i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),jr=X((e,t,i)=>{let o,n=-1;for(const a of e){const s=t(a);kr(s,i)&&s.prefix.length>n&&(n=s.prefix.length,o=a)}return o},"findBestPatternMatch"),$r=X((e,t)=>{const i=[];for(const o of e){if(!br(o))continue;const n=wr(o);if(n)i.push(n);else if(o===t)return o}return jr(i,o=>o,t)},"matchPatternOrExact"),Er=X((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),Sr=X(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),Or=X((e,t,i)=>{let o=T(t.path);t.config.compilerOptions?.baseUrl&&(o=S(e,t.config.compilerOptions.baseUrl)),i?.debug({message:`Resolved baseUrl to ${o}`,prefix:"plugin:packem:resolve-tsconfig-paths"});const n=t.config.compilerOptions?.paths??{};return Object.keys(n).length===0&&i?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:packem:resolve-tsconfig-paths"}),{paths:n,resolvedBaseUrl:o}},"getTsconfigPaths"),Vi=X((e,t,i,o)=>{const{paths:n,resolvedBaseUrl:a}=Or(e,t,i),s=Object.keys(n);return{name:"packem:resolve-tsconfig-paths",async resolveId(l,p,r){if(s.length===0)return null;if(l.includes("\0"))return i.debug({message:`Skipping resolution of ${l} as it is a virtual module`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(l.includes("node_modules"))return i.debug({message:`Skipping request as it is inside node_modules ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(!o.resolveAbsolutePath&&Pe(l))return i.debug({message:`Skipping request as it is an absolute path ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;if(wt(l))return i.debug({message:`Skipping request as it is a relative path ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const c=$r(s,l);if(!c)return i.debug({message:`moduleName did not match any paths pattern ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"}),null;const m=typeof c=="string"?void 0:Er(c,l),d=typeof c=="string"?c:Sr(c);for await(const u of n[d]){const y=m?u.replace("*",m):u;if(y.endsWith(".d.ts")||y.endsWith(".d.cts")||y.endsWith(".d.mts"))continue;const v=j(a,y);try{const h=await this.resolve(v,p,{skipSelf:!0,...r});if(h)return h}catch(h){i.debug({context:[h],message:`Failed to resolve ${v} from ${l}`,prefix:"plugin:packem:resolve-tsconfig-paths"})}}return null}}},"resolveTsconfigPathsPlugin");var Pr=Object.defineProperty,Ki=g((e,t)=>Pr(e,"name",{value:t,configurable:!0}),"u$7");const Dr=Ki((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(S(e,s))}return a},"getRootDirectories"),Gi=Ki((e,t,i)=>{const o=Dr(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 l of o){const p=j(l,n),r=await this.resolve(p,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 Cr=Object.defineProperty,Nr=g((e,t)=>Cr(e,"name",{value:t,configurable:!0}),"r$8");const Hi=Nr(()=>{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"),Yi={"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(Yi);const Xi={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(Xi);var _r=Object.defineProperty,Mr=g((e,t)=>_r(e,"name",{value:t,configurable:!0}),"g$6"),L=g(function(e,t,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(e):o?o.value:t.get(e)},"n$5"),me,$e,re;let Tr=class{static{g(this,"p")}static{Mr(this,"Mime")}constructor(...t){me.set(this,new Map),$e.set(this,new Map),re.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[o,n]of Object.entries(t)){o=o.toLowerCase(),n=n.map(l=>l.toLowerCase()),L(this,re,"f").has(o)||L(this,re,"f").set(o,new Set);const a=L(this,re,"f").get(o);let s=!0;for(let l of n){const p=l.startsWith("*");if(l=p?l.slice(1):l,a?.add(l),s&&L(this,$e,"f").set(o,l),s=!1,p)continue;const r=L(this,me,"f").get(l);if(r&&r!=o&&!i)throw new Error(`"${o} -> ${l}" conflicts with "${r} -> ${l}". Pass \`force=true\` to override this definition.`);L(this,me,"f").set(l,o)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),o=i.replace(/^.*\./,"").toLowerCase(),n=i.length<t.length;return!(o.length<i.length-1)&&n?null:L(this,me,"f").get(o)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&L(this,$e,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:L(this,re,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of L(this,re,"f").values())Object.freeze(t);return this}_getTestState(){return{types:L(this,me,"f"),extensions:L(this,$e,"f")}}};me=new WeakMap,$e=new WeakMap,re=new WeakMap;const Ir=new Tr(Xi,Yi)._freeze();var Ar=Object.defineProperty,Et=g((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"u$6");const zr=Et(async(e,t)=>{await new Promise((i,o)=>{const n=un(e);n.on("error",o);const a=fn(t);a.on("error",o),a.on("finish",i),n.pipe(a)})},"copy"),Rr=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"),Fr=Et(({destDir:e,emitFiles:t,exclude:i,fileName:o,include:n,limit:a,publicPath:s,sourceDir:l})=>{const p=Y(n,i),r={};return{async generateBundle(c){if(!t)return;const m=e??c.dir??T(c.file??"");await Dt(m),await Promise.all(Object.keys(r).map(async d=>{const u=r[d],y=j(m,T(u));await Dt(y),await zr(d,j(m,u))}))},async load(c){if(!p(c))return null;this.addWatchFile(c);const[m,d]=await Promise.all([bt(c),Ro(c)]);let u;if(a&&m.size>a||a===0){const y=cn.createHash("sha1").update(d).digest("hex").slice(0,16),v=Ge(c),h=ne(c,v),f=l?_(l,T(c)):ne(T(c)),x=o.replaceAll("[hash]",y).replaceAll("[extname]",v).replaceAll("[dirname]",f===""?"":`${f}/`).replaceAll("[name]",h);u=j(s??"",x),r[c]=x}else{const y=Ir.getType(c);if(y===null)throw new Error(`Could not determine mimetype for ${c}`);const v=y==="image/svg+xml";u=v?Rr(d):d.toString("base64"),u=`data:${y}${v?"":";base64"},${u}`}return`export default "${u}"`},name:"packem:url"}},"urlPlugin");var Lr=Object.defineProperty,Jr=g((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"s$8");const Br=Jr(e=>{const t=ne(e).split(".");if(t.length>=2){const[i,o]=t.slice(-2),n=t[0],a=/^(\w+)-runtime$/.exec(i)?.[1];if(He.includes(o)&&a&&a.length>0)return n+"-"+a}},"getCustomModuleLayer");var qr=Object.defineProperty,Wr=g((e,t)=>qr(e,"name",{value:t,configurable:!0}),"i$5");const pt=Wr(e=>(e.preserveDirectives||{directives:[]}).directives.map(t=>t.replace(/^use /,"")).find(t=>t!=="strict"),"getModuleLayer");var Ur=Object.defineProperty,Xt=g((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"d$9");const Vr=Xt((e,t)=>{const i=new Map;return Xt(function(o,n){const a=n.getModuleInfo(o);if(!a)return;const{isEntry:s}=a,l=a.meta,p=pt(l);if(!s){const r=i.get(o);if(r)return r;const c=Br(o);if(c)return i.set(o,c),c}if(s){const r=n.getModuleIds();for(const c of r)n.getModuleInfo(c)&&pt(l)===p&&(e.has(c)||e.set(c,new Set),e.get(c).add([o,p]))}if(p&&!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 pt(d?d.meta:{})===p}return!1}))return;if(r.every(([,m])=>m===p))return i.has(o)?i.get(o):void 0;const c=ne(o,Ge(o))+"-"+p;return i.set(o,c),c}},"splitChunks")},"createSplitChunks");var Kr=Object.defineProperty,Gr=g((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"n$4");const oe=Gr((e,t)=>e.isDynamicEntry?`${Pn}/[name].${t}`:`${Dn}/${e.name}-[hash].${t}`,"getChunkFilename");var Hr=Object.defineProperty,Yr=g((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"o$4");const Xr=process.platform==="win32",Qt=Yr((e,t)=>{const i=Xr?"\\":"/";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 Qr=Object.defineProperty,A=g((e,t)=>Qr(e,"name",{value:t,configurable:!0}),"e$6");const Qi=A((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"),Zr=A((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"+vo.node.split(".")[0];if(t.pkg.engines?.node){const o=xi(t.pkg.engines.node);o&&(i="node"+o.major)}if(t.options.rollup.esbuild.target){const o=Ee(t.options.rollup.esbuild.target);o.some(n=>n.startsWith("node"))||(t.options.rollup.esbuild.target=[...new Set([...Ee(i),...o])])}else t.options.rollup.esbuild.target=Ee(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"),Zi=A((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(_(S(),e.id))}"
|
|
90
90
|
Is the module installed? Note:
|
|
91
91
|
↳ to inline a module into your bundle, install it to "devDependencies".
|
|
92
92
|
↳ 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"),eo=A((e,t)=>({input:Object.fromEntries(e.options.entries.map(i=>[i.name,S(e.options.rootDir,i.input)])),logLevel:e.options.debug?"debug":"info",onLog:A((i,o)=>{let n=o.message;switch(o.stack&&(n=`${n}
|
|
@@ -107,7 +107,7 @@ ${s.chunks.map(r=>{const c=t.buildEntries.find(m=>m.path===r)??{};return ee("
|
|
|
107
107
|
└─ `)+V(i(l.path))+" (total size: "+D(Z(l.bytes??0))+")");s+=`
|
|
108
108
|
|
|
109
109
|
`,e.raw(s)}return o&&e.raw("Σ Total dist size (byte size):",D(Z(t.buildEntries.reduce((s,l)=>s+(l.bytes??0),0),{decimals:2})),`
|
|
110
|
-
`),o},"showSizeInformation"),ml=qe((e,t)=>{const i=pl(e.options.entries,"environment","runtime"),o=new Set,n=new Set;for(const[a,s]of Object.entries(i))for(const[l,p]of Object.entries(s)){const r={...e};!e.options.dtsOnly&&(a!=="undefined"||l!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":D(a)+" environment"+(l==="undefined"?"":" with "))+(l==="undefined"?"":D(l)+" 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(l==="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+"/"),l!=="undefined"&&(m+=l+"/");let d=!1;r.options.minify!==void 0&&(d=r.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],y=[],v=[],h=[];for(const f of p)f.cjs&&f.esm?u.push(f):f.cjs?v.push(f):f.esm?y.push(f):f.declaration&&h.push(f);if(u.length>0){const f={...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:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}if(y.length>0){const f={...r,options:{...r.options,emitCJS:!1,emitESM:!0,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}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}if(v.length>0){const f={...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||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}r.options.declaration&&h.length>0&&n.add({context:{...r,options:{...r.options,emitCJS:!1,emitESM:!1,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}}},fileCache:t,subDirectory:m})}return{builders:o,typeBuilders:n}},"prepareRollupConfig"),ul=qe(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:o}=ml(e,t);await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await nl(n,a,s))),await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await sl(n,a,s))),e.logger.success(So(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of wo(j(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>j(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 bt(S(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),dl(e.logger,e)},"build");var fl=Object.defineProperty,gl=g((e,t)=>fl(e,"name",{value:t,configurable:!0}),"r$6");const P=gl((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var vl=Object.defineProperty,oo=g((e,t)=>vl(e,"name",{value:t,configurable:!0}),"t$3");const We=oo(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),xt=oo((e,t,i,o)=>{if(e==="module-sync")return"esm";if(o){const s=We(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 xt(n,a,i,o)},"inferExportType");var hl=Object.defineProperty,xl=g((e,t)=>hl(e,"name",{value:t,configurable:!0}),"y$3");const yl=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...kt,...Je]),St=xl((e,t,i,o=[])=>{if(!e)return[];if(typeof e=="string"){const n=We(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,l]of n)if(typeof l=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:l,key:"exports",type:xt(s,o,t,l)})}else if(typeof l=="object"&&l!==null)for(const[p,r]of Object.entries(l)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof r=="string"?a.push({exportKey:c.replace("./",""),file:r,key:"exports",...yl.has(p)?{subKey:p}:{},type:xt(p,o,t,r)}):a=[...a,...St({[c]:r},t,i,[...o,p])]}return a}return[]},"extractExportFilenames");var bl=Object.defineProperty,et=g((e,t)=>bl(e,"name",{value:t,configurable:!0}),"y$2");const wl=et((e,t)=>e.key==="exports"&&e.subKey===G?G:e.key==="exports"&&e.subKey===Oe?Oe:t,"getEnvironment"),Te=et((e,t,i,o,n,a,s)=>{const l=wl(n,a.environment);let p="node";for(const m of kt)if(n.file.includes("."+m+".")||n.subKey===m){p=m;break}let r=e.find(m=>m.input===t&&m.environment===l&&m.runtime===p);r===void 0?r=e[e.push({environment:l,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:p})-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(/^\.\//,"")}/`),"");Je.has(n.subKey)&&!t.includes(c)&&(r.fileAlias=c)},"createOrUpdateEntry");let ti=!1;const ii=et(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"),kl=et((e,t,i)=>{const o=[];t.sort((l,p)=>l.split("/").length-p.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(i.options.emitESM=!0),n==="cjs"&&(i.options.emitCJS=!0);const a=St(e.exports,n,i.options.declaration);if(e.bin){const l=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of l){const r=We(p);if(r&&r!==n)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:r??n})}}e.main&&a.push({file:e.main,key:"main",type:We(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(ii(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const l of a){const p=Ge(l.file);if(p!==""&&!He.includes(p))continue;i.options.declaration===void 0&&(l.key==="types"||l.subKey==="types")&&(i.options.declaration=l.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&l.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&l.type==="esm"&&(i.options.emitESM=!0);const r=l.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=r.endsWith("/");if(c&&["./","/"].includes(r))continue;const m=r.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",u=c?"":"(\\.[cm]?[tj]sx?)$";if(l.file.includes("/*")&&l.key==="exports"){ti||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),ti=!0);const f=[],x=new RegExp(d+m.replace("*","(.*)")+u),k=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+u);for(const w of t)(x.test(w)||Je.has(l.subKey)&&k.test(w))&&f.push(w);if(f.length===0){o.push(`Could not find entrypoint for \`${l.file}\``);continue}for(const w of f)Te(s,w,c,r,l,i,!0);continue}const y=new RegExp(d+m+u);let v=t.find(f=>y.test(f));if(Je.has(l.subKey)&&v===void 0){const f=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1")+u);v=t.find(x=>f.test(x))}if(v===void 0){z(S(i.options.rootDir,l.file))||o.push(`Could not find entrypoint for \`${l.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&z(v)&&ii(i);const h=Fe(v.replace(ae,""));z(h+".cts")&&z(h+".mts")?(Te(s,h+".cts",c,r,{...l,type:"cjs"},i,!1),Te(s,h+".mts",c,r,{...l,type:"esm"},i,!1)):Te(s,v,c,r,l,i,!1)}return{entries:s,warnings:o}},"inferEntries");var jl=Object.defineProperty,$l=g((e,t)=>jl(e,"name",{value:t,configurable:!0}),"o$3");const El=$l((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 Sl=Object.defineProperty,Ol=g((e,t)=>Sl(e,"name",{value:t,configurable:!0}),"t$2");const Pl={hooks:{"build:prepare":Ol(function(e){if(e.options.entries.length>0)return;const t=j(e.options.rootDir,e.options.sourceDir);if(!z(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=ko(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=El(o,e.options.declaration));const n=kl(o,i,e);for(const a of n.warnings)P(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?V(a.fileAlias)+" => "+V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),ee([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Dl=Object.defineProperty,Cl=g((e,t)=>Dl(e,"name",{value:t,configurable:!0}),"t$1");const Nl=Cl(async(e,t)=>{if(e==="auto")e=Pl;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var _l=Object.defineProperty,Ml=g((e,t)=>_l(e,"name",{value:t,configurable:!0}),"j");const Tl=Ml(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],o=JSON.stringify({...e.options.jiti,alias:{...Qe(e.pkg,e.options),...e.options.jiti.alias},transformOptions:{...e.options.jiti.transformOptions,babel:{...e.options.jiti.transformOptions?.babel,plugins:"__$BABEL_PLUGINS"}}},null,2).replace('"__$BABEL_PLUGINS"',Array.isArray(t)?"["+t.map((n,a)=>{if(Array.isArray(n)){const[s,...l]=n;return i.push(s),"["+["plugin"+a,...l.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=S(e.options.rootDir,e.options.outDir,n.name),s=nn(e.jiti.esmResolve(n.input,{try:!0})??n.input),l=s.replace(ae,""),p=Ke(s),r=or(p);let c=[];try{c=await an(s,{extensions:He})}catch(d){P(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=_(T(a),await Mt("jiti",{conditions:["node","import"],url:import.meta.url})),u=l+".d.mts";le(`${a}.mjs`,r+['import { createJiti } from "'+d+'";',...i.map((y,v)=>"import plugin"+v+' from "'+y+'";'),"","const jiti = createJiti(import.meta.url, "+o+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
|
|
110
|
+
`),o},"showSizeInformation"),ml=qe((e,t)=>{const i=pl(e.options.entries,"environment","runtime"),o=new Set,n=new Set;for(const[a,s]of Object.entries(i))for(const[l,p]of Object.entries(s)){const r={...e};!e.options.dtsOnly&&(a!=="undefined"||l!=="undefined")&&e.logger.info("Preparing build for "+(a==="undefined"?"":D(a)+" environment"+(l==="undefined"?"":" with "))+(l==="undefined"?"":D(l)+" 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(l==="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+"/"),l!=="undefined"&&(m+=l+"/");let d=!1;r.options.minify!==void 0&&(d=r.options.minify),a==="development"?d=!1:a==="production"&&(d=!0);const u=[],y=[],v=[],h=[];for(const f of p)f.cjs&&f.esm?u.push(f):f.cjs?v.push(f):f.esm?y.push(f):f.declaration&&h.push(f);if(u.length>0){const f={...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:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}if(y.length>0){const f={...r,options:{...r.options,emitCJS:!1,emitESM:!0,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}}};if(e.options.dtsOnly||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}if(v.length>0){const f={...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||o.add({context:f,fileCache:t,subDirectory:m}),e.options.declaration){const x=f.options.entries.filter(k=>k.declaration);x.length>0&&n.add({context:{...f,options:{...f.options,entries:x}},fileCache:t,subDirectory:m})}}r.options.declaration&&h.length>0&&n.add({context:{...r,options:{...r.options,emitCJS:!1,emitESM:!1,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}}},fileCache:t,subDirectory:m})}return{builders:o,typeBuilders:n}},"prepareRollupConfig"),ul=qe(async(e,t)=>{await e.hooks.callHook("build:before",e);const{builders:i,typeBuilders:o}=ml(e,t);await Promise.all([...i].map(async({context:n,fileCache:a,subDirectory:s})=>await nl(n,a,s))),await Promise.all([...o].map(async({context:n,fileCache:a,subDirectory:s})=>await sl(n,a,s))),e.logger.success(So(e.options.name?"Build succeeded for "+e.options.name:"Build succeeded"));for await(const n of wo(j(e.options.rootDir,e.options.outDir))){let a=e.buildEntries.find(s=>j(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 bt(S(e.options.rootDir,e.options.outDir,n.path));a.bytes=s.size}}return await e.hooks.callHook("build:done",e),dl(e.logger,e)},"build");var fl=Object.defineProperty,gl=g((e,t)=>fl(e,"name",{value:t,configurable:!0}),"r$5");const P=gl((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var vl=Object.defineProperty,oo=g((e,t)=>vl(e,"name",{value:t,configurable:!0}),"t$3");const We=oo(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),xt=oo((e,t,i,o)=>{if(e==="module-sync")return"esm";if(o){const s=We(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 xt(n,a,i,o)},"inferExportType");var hl=Object.defineProperty,xl=g((e,t)=>hl(e,"name",{value:t,configurable:!0}),"y$3");const yl=new Set(["electron","import","require","node","node-addons","default","types","deno","browser","module-sync","bun","workerd",...kt,...Je]),St=xl((e,t,i,o=[])=>{if(!e)return[];if(typeof e=="string"){const n=We(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,l]of n)if(typeof l=="string"){let p={};Number.isInteger(+s)?p={exportKey:"*"}:s.startsWith("./")?p={exportKey:s.replace("./","")}:p={exportKey:s==="."?".":"*",subKey:s},a.push({...p,file:l,key:"exports",type:xt(s,o,t,l)})}else if(typeof l=="object"&&l!==null)for(const[p,r]of Object.entries(l)){if(i===!1&&p==="types")continue;const c=Number.isInteger(+s)?p:s;typeof r=="string"?a.push({exportKey:c.replace("./",""),file:r,key:"exports",...yl.has(p)?{subKey:p}:{},type:xt(p,o,t,r)}):a=[...a,...St({[c]:r},t,i,[...o,p])]}return a}return[]},"extractExportFilenames");var bl=Object.defineProperty,et=g((e,t)=>bl(e,"name",{value:t,configurable:!0}),"y$2");const wl=et((e,t)=>e.key==="exports"&&e.subKey===G?G:e.key==="exports"&&e.subKey===Oe?Oe:t,"getEnvironment"),Te=et((e,t,i,o,n,a,s)=>{const l=wl(n,a.environment);let p="node";for(const m of kt)if(n.file.includes("."+m+".")||n.subKey===m){p=m;break}let r=e.find(m=>m.input===t&&m.environment===l&&m.runtime===p);r===void 0?r=e[e.push({environment:l,exportKey:new Set([n.exportKey].filter(Boolean)),input:t,runtime:p})-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(/^\.\//,"")}/`),"");Je.has(n.subKey)&&!t.includes(c)&&(r.fileAlias=c)},"createOrUpdateEntry");let ti=!1;const ii=et(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"),kl=et((e,t,i)=>{const o=[];t.sort((l,p)=>l.split("/").length-p.split("/").length);const n=e.type==="module"?"esm":"cjs";n==="esm"&&(i.options.emitESM=!0),n==="cjs"&&(i.options.emitCJS=!0);const a=St(e.exports,n,i.options.declaration);if(e.bin){const l=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const p of l){const r=We(p);if(r&&r!==n)throw new Error(`Exported file "${p}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:p,isExecutable:!0,key:"bin",type:r??n})}}e.main&&a.push({file:e.main,key:"main",type:We(e.main)??n}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),(e.types||e.typings)&&(ii(i),i.options.declaration===void 0&&(i.options.declaration="compatible"),a.push({file:e.types??e.typings,key:"types"}));const s=[];for(const l of a){const p=Ge(l.file);if(p!==""&&!He.includes(p))continue;i.options.declaration===void 0&&(l.key==="types"||l.subKey==="types")&&(i.options.declaration=l.file.includes(".d.ts")?"compatible":!0),i.options.emitCJS===void 0&&l.type==="cjs"&&(i.options.emitCJS=!0),i.options.emitESM===void 0&&l.type==="esm"&&(i.options.emitESM=!0);const r=l.file.replace(/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,""),c=r.endsWith("/");if(c&&["./","/"].includes(r))continue;const m=r.replace(new RegExp("(./)?"+i.options.outDir),i.options.sourceDir).replace("./",""),d="(?<=/|$)",u=c?"":"(\\.[cm]?[tj]sx?)$";if(l.file.includes("/*")&&l.key==="exports"){ti||(i.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),ti=!0);const f=[],x=new RegExp(d+m.replace("*","(.*)")+u),k=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1").replace("*","(.*)")+u);for(const w of t)(x.test(w)||Je.has(l.subKey)&&k.test(w))&&f.push(w);if(f.length===0){o.push(`Could not find entrypoint for \`${l.file}\``);continue}for(const w of f)Te(s,w,c,r,l,i,!0);continue}const y=new RegExp(d+m+u);let v=t.find(f=>y.test(f));if(Je.has(l.subKey)&&v===void 0){const f=new RegExp(d+m.replace(/(.*)\.[^.]*$/,"$1")+u);v=t.find(x=>f.test(x))}if(v===void 0){z(S(i.options.rootDir,l.file))||o.push(`Could not find entrypoint for \`${l.file}\``);continue}(v.endsWith(".ts")||v.endsWith(".cts")||v.endsWith(".mts"))&&z(v)&&ii(i);const h=Fe(v.replace(ae,""));z(h+".cts")&&z(h+".mts")?(Te(s,h+".cts",c,r,{...l,type:"cjs"},i,!1),Te(s,h+".mts",c,r,{...l,type:"esm"},i,!1)):Te(s,v,c,r,l,i,!1)}return{entries:s,warnings:o}},"inferEntries");var jl=Object.defineProperty,$l=g((e,t)=>jl(e,"name",{value:t,configurable:!0}),"o$3");const El=$l((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 Sl=Object.defineProperty,Ol=g((e,t)=>Sl(e,"name",{value:t,configurable:!0}),"t$2");const Pl={hooks:{"build:prepare":Ol(function(e){if(e.options.entries.length>0)return;const t=j(e.options.rootDir,e.options.sourceDir);if(!z(t))throw new Error("No 'src' directory found. Please provide entries manually.");const i=ko(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=El(o,e.options.declaration));const n=kl(o,i,e);for(const a of n.warnings)P(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?V(a.fileAlias)+" => "+V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*")):V(a.input.replace(`${e.options.rootDir}/`,"").replace(/\/$/,"/*"))).join(", ")),ee([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(a=>`[${a}]`).join(" ")))},"build:prepare")}};var Dl=Object.defineProperty,Cl=g((e,t)=>Dl(e,"name",{value:t,configurable:!0}),"t$1");const Nl=Cl(async(e,t)=>{if(e==="auto")e=Pl;else{if(e==="none")return{};typeof e=="string"&&(e=await t.import(e)||{})}return typeof e=="function"&&(e=e()),e},"resolvePreset");var _l=Object.defineProperty,Ml=g((e,t)=>_l(e,"name",{value:t,configurable:!0}),"j");const Tl=Ml(async e=>{const t=e.options.jiti.transformOptions?.babel?.plugins,i=[],o=JSON.stringify({...e.options.jiti,alias:{...Qe(e.pkg,e.options),...e.options.jiti.alias},transformOptions:{...e.options.jiti.transformOptions,babel:{...e.options.jiti.transformOptions?.babel,plugins:"__$BABEL_PLUGINS"}}},null,2).replace('"__$BABEL_PLUGINS"',Array.isArray(t)?"["+t.map((n,a)=>{if(Array.isArray(n)){const[s,...l]=n;return i.push(s),"["+["plugin"+a,...l.map(p=>JSON.stringify(p))].join(", ")+"]"}return i.push(n),"plugin"+a}).join(",")+"]":"[]");for(const n of e.options.entries){const a=S(e.options.rootDir,e.options.outDir,n.name),s=nn(e.jiti.esmResolve(n.input,{try:!0})??n.input),l=s.replace(ae,""),p=Ke(s),r=or(p);let c=[];try{c=await an(s,{extensions:He})}catch(d){P(e,`Cannot analyze ${s} for exports: ${d.toString()}`);return}const m=c.includes("default")||c.length===0;if(e.options.emitESM){const d=_(T(a),await Mt("jiti",{conditions:["node","import"],url:import.meta.url})),u=l+".d.mts";le(`${a}.mjs`,r+['import { createJiti } from "'+d+'";',...i.map((y,v)=>"import plugin"+v+' from "'+y+'";'),"","const jiti = createJiti(import.meta.url, "+o+");","",'/** @type {import("'+u+'")} */','const _module = await jiti.import("'+s+'");',m?`
|
|
111
111
|
export default _module;`:"",...c.filter(y=>y!=="default").map(y=>`export const ${y} = _module.${y};`)].join(`
|
|
112
112
|
`)),e.options.declaration&&le(`${a}.d.mts`,'export * from "'+u+`";
|
|
113
113
|
`+(m?'export { default } from "'+u+'";':""))}if(e.options.emitCJS){const d=_(T(a),await Mt("jiti",{conditions:["node","require"],url:import.meta.url})),u=l+".d.cts";le(`${a}.cjs`,r+['const { createJiti } = require("'+d+'");',...i.map((y,v)=>"const plugin"+v+" = require("+JSON.stringify(y)+")"),"","const jiti = createJiti(__filename, "+o+");","",'/** @type {import("'+u+'")} */','module.exports = jiti("'+s+'")'].join(`
|
|
@@ -122,13 +122,13 @@ ${t}`)},"enhanceRollupError");var Rl=Object.defineProperty,ao=g((e,t)=>Rl(e,"nam
|
|
|
122
122
|
⚡️ Build run in `+r.duration+`ms
|
|
123
123
|
|
|
124
124
|
`),await n?.(!0);break}case"ERROR":{no(r.error),e.logger.error({context:[r.error],message:"Rebuild failed: "+r.error.message,prefix:p});break}}})},"watchHandler"),Fl=ao(async(e,t,i,o,n)=>{const a=await to(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(Ue)),e.options.rollup.watch&&typeof a.watch=="object"&&a.watch.include===void 0&&(a.watch={...a.watch,...e.options.rollup.watch},a.watch.include=[j(e.options.sourceDir,"**","*"),"package.json","packem.config.*","tsconfig.json","tsconfig.*.json"],Array.isArray(e.options.rollup.watch.include)?a.watch.include=[...a.watch.include,...e.options.rollup.watch.include]:e.options.rollup.watch.include&&a.watch.include.push(e.options.rollup.watch.include),a.watch.chokidar={cwd:e.options.rootDir,...a.watch.chokidar,ignored:["**/.git/**","**/node_modules/**","**/test-results/**",...a.watch.chokidar?.ignored??[]]});const l=Nt(a);await e.hooks.callHook("rollup:watch",e,l);const p=[...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 p)r+=ee(`
|
|
125
|
-
└─ ${_(process.cwd(),c)}`);if(e.logger.info(r),oi({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:o,useCache:s,watcher:l}),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 io(e,t);s&&(c.cache=t.get("dts-"+Ue)),await e.hooks.callHook("rollup:dts:options",e,c);const m=Nt(c);await e.hooks.callHook("rollup:watch",e,m),oi({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Ll=Object.defineProperty,Jl=g((e,t)=>Ll(e,"name",{value:t,configurable:!0}),"s$5");const Bl=Jl(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 jo(i))},"cleanDistributionDirectories");var ql=Object.defineProperty,Wl=g((e,t)=>ql(e,"name",{value:t,configurable:!0}),"i$2");const Ul=Wl((e,t,i,o)=>{try{let n={};const a=j(t,"keystore.json");o&&z(a)&&(n=mi(a)),n[e]===void 0&&(n[e]=new Date().toISOString()),yt(a,n,{overwrite:!0})}catch(n){i.debug({context:n,message:n.message,prefix:"cache-key-store"})}},"createOrUpdateKeyStorage");var Vl=Object.defineProperty,so=g((e,t)=>Vl(e,"name",{value:t,configurable:!0}),"s$4");const Kl=so(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let Gl=class{static{g(this,"g")}static{so(this,"FileCache")}#e;#i;#a;#r=!0;#s=new Map;constructor(t,i,o,n){this.#e=t,this.#a=o,i===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#i=i,n.debug({message:"Cache path is: "+this.#i,prefix:"file-cache"}))}set isEnabled(t){this.#r=t}has(t,i){return!this.#r||this.#i===void 0?!1:z(this.getFilePath(t,i))}get(t,i){if(!this.#r||this.#i===void 0)return;const o=this.getFilePath(t,i);if(this.#s.has(o))return this.#s.get(o);if(!z(o))return;const n=Ke(o);if(Kl(n)){const a=JSON.parse(n);return this.#s.set(o,a),a}return this.#s.set(o,n),n}set(t,i,o){if(!this.#r||this.#i===void 0||i===void 0)return;const n=this.getFilePath(t,o);(typeof i=="object"||typeof i=="number"||typeof i=="boolean")&&(i=JSON.stringify(i)),le(n,i,{overwrite:!0})}getFilePath(t,i){let o=t.replaceAll(Fe(this.#e),"");return o=o.replaceAll(":","-"),j(this.#i,this.#a,i?.replaceAll(":","-")??"",Fe(o))}};var Hl=Object.defineProperty,Ie=g((e,t)=>Hl(e,"name",{value:t,configurable:!0}),"l$4");const Yl=Y,Xl=Ie((e,t)=>{const{sideEffects:i}=t;let o;if(typeof i=="boolean")o=Ie(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)o=Ie(()=>!1,"hasSideEffects");else{const n=i.map(a=>a.includes("/")?a:`**/${a}`);o=Yl(n,null,{resolve:e})}else o=Ie(()=>null,"hasSideEffects");return o},"getPackageSideEffect");var ct,ni;function Ql(){if(ni)return ct;ni=1;var e=Object.defineProperty,t=g((p,r)=>e(p,"name",{value:r,configurable:!0}),"s"),i=xn,o=i.spawn,n=i.exec;ct=g(function(p,r,c){if(typeof r=="function"&&c===void 0&&(c=r,r=void 0),p=parseInt(p),Number.isNaN(p)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var m={},d={};switch(m[p]=[],d[p]=1,process.platform){case"win32":n("taskkill /pid "+p+" /T /F",c);break;case"darwin":l(p,m,d,function(u){return o("pgrep",["-P",u])},function(){a(m,r,c)});break;default:l(p,m,d,function(u){return o("ps",["-o","pid","--no-headers","--ppid",u])},function(){a(m,r,c)});break}},"treeKill");function a(p,r,c){var m={};try{Object.keys(p).forEach(function(d){p[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()}g(a,"killAll"),t(a,"killAll");function s(p,r){try{process.kill(parseInt(p,10),r)}catch(c){if(c.code!=="ESRCH")throw c}}g(s,"killPid"),t(s,"killPid");function l(p,r,c,m,d){var u=m(p),y="";u.stdout.on("data",function(f){var f=f.toString("ascii");y+=f});var v=t(function(h){if(delete c[p],h!=0){Object.keys(c).length==0&&d();return}y.match(/\d+/g).forEach(function(f){f=parseInt(f,10),r[p].push(f),r[f]=[],c[f]=1,l(f,r,c,m,d)})},"onClose");u.on("close",v)}return g(l,"buildProcessTree"),t(l,"buildProcessTree"),ct}g(Ql,"requireTreeKill");var Zl=Ql();const ep=Pi(Zl);var tp=Object.defineProperty,ro=g((e,t)=>tp(e,"name",{value:t,configurable:!0}),"l$3");const ip=ro(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),op=ro(async({pid:e,signal:t})=>await new Promise((i,o)=>{if(!Number.isInteger(e)||e<=0){o(new Error("Invalid process ID"));return}ep(e,t,n=>{if(n&&!ip(n)){o(n);return}i()})}),"killProcess");var np=Object.defineProperty,ap=g((e,t)=>np(e,"name",{value:t,configurable:!0}),"n$1");const lo=ap(e=>{const t=j(e,"package.json");if(!z(t))throw new Error("package.json not found at "+t);return{packageJson:wi(t),packageJsonPath:t}},"loadPackageJson");var sp=Object.defineProperty,rp=g((e,t)=>sp(e,"name",{value:t,configurable:!0}),"r$
|
|
125
|
+
└─ ${_(process.cwd(),c)}`);if(e.logger.info(r),oi({context:e,doOnSuccessCleanup:n,fileCache:t,mode:"bundle",runBuilder:i,runOnsuccess:o,useCache:s,watcher:l}),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 io(e,t);s&&(c.cache=t.get("dts-"+Ue)),await e.hooks.callHook("rollup:dts:options",e,c);const m=Nt(c);await e.hooks.callHook("rollup:watch",e,m),oi({context:e,fileCache:t,mode:"types",useCache:s,watcher:m})}},"watch");var Ll=Object.defineProperty,Jl=g((e,t)=>Ll(e,"name",{value:t,configurable:!0}),"s$5");const Bl=Jl(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 jo(i))},"cleanDistributionDirectories");var ql=Object.defineProperty,Wl=g((e,t)=>ql(e,"name",{value:t,configurable:!0}),"i$2");const Ul=Wl((e,t,i,o)=>{try{let n={};const a=j(t,"keystore.json");o&&z(a)&&(n=mi(a)),n[e]===void 0&&(n[e]=new Date().toISOString()),yt(a,n,{overwrite:!0})}catch(n){i.debug({context:[n],message:n.message,prefix:"cache-key-store"})}},"createOrUpdateKeyStorage");var Vl=Object.defineProperty,so=g((e,t)=>Vl(e,"name",{value:t,configurable:!0}),"s$4");const Kl=so(e=>{try{JSON.parse(e)}catch{return!1}return!0},"isJson");let Gl=class{static{g(this,"g")}static{so(this,"FileCache")}#e;#i;#a;#r=!0;#s=new Map;constructor(t,i,o,n){this.#e=t,this.#a=o,i===void 0?n.debug({message:"Could not create cache directory.",prefix:"file-cache"}):(this.#i=i,n.debug({message:"Cache path is: "+this.#i,prefix:"file-cache"}))}set isEnabled(t){this.#r=t}has(t,i){return!this.#r||this.#i===void 0?!1:z(this.getFilePath(t,i))}get(t,i){if(!this.#r||this.#i===void 0)return;const o=this.getFilePath(t,i);if(this.#s.has(o))return this.#s.get(o);if(!z(o))return;const n=Ke(o);if(Kl(n)){const a=JSON.parse(n);return this.#s.set(o,a),a}return this.#s.set(o,n),n}set(t,i,o){if(!this.#r||this.#i===void 0||i===void 0)return;const n=this.getFilePath(t,o);(typeof i=="object"||typeof i=="number"||typeof i=="boolean")&&(i=JSON.stringify(i)),le(n,i,{overwrite:!0})}getFilePath(t,i){let o=t.replaceAll(Fe(this.#e),"");return o=o.replaceAll(":","-"),j(this.#i,this.#a,i?.replaceAll(":","-")??"",Fe(o))}};var Hl=Object.defineProperty,Ie=g((e,t)=>Hl(e,"name",{value:t,configurable:!0}),"l$4");const Yl=Y,Xl=Ie((e,t)=>{const{sideEffects:i}=t;let o;if(typeof i=="boolean")o=Ie(()=>i,"hasSideEffects");else if(Array.isArray(i))if(i.length<=0)o=Ie(()=>!1,"hasSideEffects");else{const n=i.map(a=>a.includes("/")?a:`**/${a}`);o=Yl(n,null,{resolve:e})}else o=Ie(()=>null,"hasSideEffects");return o},"getPackageSideEffect");var ct,ni;function Ql(){if(ni)return ct;ni=1;var e=Object.defineProperty,t=g((p,r)=>e(p,"name",{value:r,configurable:!0}),"s"),i=xn,o=i.spawn,n=i.exec;ct=g(function(p,r,c){if(typeof r=="function"&&c===void 0&&(c=r,r=void 0),p=parseInt(p),Number.isNaN(p)){if(c)return c(new Error("pid must be a number"));throw new Error("pid must be a number")}var m={},d={};switch(m[p]=[],d[p]=1,process.platform){case"win32":n("taskkill /pid "+p+" /T /F",c);break;case"darwin":l(p,m,d,function(u){return o("pgrep",["-P",u])},function(){a(m,r,c)});break;default:l(p,m,d,function(u){return o("ps",["-o","pid","--no-headers","--ppid",u])},function(){a(m,r,c)});break}},"treeKill");function a(p,r,c){var m={};try{Object.keys(p).forEach(function(d){p[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()}g(a,"killAll"),t(a,"killAll");function s(p,r){try{process.kill(parseInt(p,10),r)}catch(c){if(c.code!=="ESRCH")throw c}}g(s,"killPid"),t(s,"killPid");function l(p,r,c,m,d){var u=m(p),y="";u.stdout.on("data",function(f){var f=f.toString("ascii");y+=f});var v=t(function(h){if(delete c[p],h!=0){Object.keys(c).length==0&&d();return}y.match(/\d+/g).forEach(function(f){f=parseInt(f,10),r[p].push(f),r[f]=[],c[f]=1,l(f,r,c,m,d)})},"onClose");u.on("close",v)}return g(l,"buildProcessTree"),t(l,"buildProcessTree"),ct}g(Ql,"requireTreeKill");var Zl=Ql();const ep=Pi(Zl);var tp=Object.defineProperty,ro=g((e,t)=>tp(e,"name",{value:t,configurable:!0}),"l$3");const ip=ro(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),op=ro(async({pid:e,signal:t})=>await new Promise((i,o)=>{if(!Number.isInteger(e)||e<=0){o(new Error("Invalid process ID"));return}ep(e,t,n=>{if(n&&!ip(n)){o(n);return}i()})}),"killProcess");var np=Object.defineProperty,ap=g((e,t)=>np(e,"name",{value:t,configurable:!0}),"n$1");const lo=ap(e=>{const t=j(e,"package.json");if(!z(t))throw new Error("package.json not found at "+t);return{packageJson:wi(t),packageJsonPath:t}},"loadPackageJson");var sp=Object.defineProperty,rp=g((e,t)=>sp(e,"name",{value:t,configurable:!0}),"r$3");const ai=rp((e,t)=>{if(e.warnings.size>0&&(t&&e.logger.raw(`
|
|
126
126
|
`),e.logger.warn(`Build is done with some warnings:
|
|
127
127
|
|
|
128
128
|
${[...e.warnings].map(i=>`- ${i}`).join(`
|
|
129
|
-
`)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var lp=Object.defineProperty,po=g((e,t)=>lp(e,"name",{value:t,configurable:!0}),"r$
|
|
129
|
+
`)}`),e.options.failOnWarn))throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")},"logBuildErrors");var lp=Object.defineProperty,po=g((e,t)=>lp(e,"name",{value:t,configurable:!0}),"r$2");const si=po(async(e,t)=>{if(typeof e.name!="string"){let i=Pe(e.input)?_(t.options.rootDir,e.input):K(e.input);i.startsWith("./")&&(i=i.slice(2)),e.name=i.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(ae,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);wt(e.input)&&(e.input=S(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=S(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),pp=po(async e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:_t(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:_t(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=Xo([o.input],{cwd:e.options.rootDir,dot:!1,ignore:n,onlyFiles:!0});if(a.length===0)throw new yn("No files found in the glob pattern: "+D(j(e.options.rootDir,o.input)));for(const s of a)e.options.entries.push({...o,input:S(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 si(t,e);for(const t of e.options.entries.filter(i=>i.fileAlias!==void 0))t.name=t.fileAlias,t.fileAlias=void 0,await si(t,e)},"prepareEntries");var cp=Object.defineProperty,dp=g((e,t)=>cp(e,"name",{value:t,configurable:!0}),"a$4");const mp=dp(async(e,t,i)=>{if(e&&await Ve(j(e,"keystore.json"))){const o=await $o(j(e,"keystore.json"));let n=await Fo(e,{withFileTypes:!0});n=n.filter(s=>s.isDirectory());let a=i;for(const s of n)if(!o[s.name]){try{await Lo(j(e,s.name),{force:!0,recursive:!0})}catch(l){t.error({message:`Failed to remove cache directory ${s.name}: ${l instanceof Error?l.message:String(l)}`,prefix:"file-cache"});continue}a&&t.raw(`
|
|
130
130
|
|
|
131
|
-
`),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var up=Object.defineProperty,fp=g((e,t)=>up(e,"name",{value:t,configurable:!0}),"a$3");const gp=fp((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var vp=Object.defineProperty,hp=g((e,t)=>vp(e,"name",{value:t,configurable:!0}),"a$2");const xp=hp((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var yp=Object.defineProperty,bp=g((e,t)=>yp(e,"name",{value:t,configurable:!0}),"o$1");const wp=bp(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=xp(n);!gp(e.options.externals,n)&&!n.startsWith("chunks/")&&![...Tt.builtinModules,...Tt.builtinModules.map(s=>`node:${s}`)].includes(a)&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&e.pkg.peerDependenciesMeta?.[a]?.optional!==!0&&o.add(n)}i.size>0&&P(e,`Potential unused dependencies found: ${[...i].map(n=>D(n)).join(", ")}`),o.size>0&&P(e,`Potential implicit dependencies found: ${[...o].map(n=>D(n)).join(", ")}`)},"validateDependencies");var kp=Object.defineProperty,co=g((e,t)=>kp(e,"name",{value:t,configurable:!0}),"i$1");const jp=co((e,t)=>bn(e,t)<=e.length/3||t.includes(e),"isSimilar"),$p=co((e,t)=>{const i=e.toLowerCase();return t.filter(o=>jp(o.toLowerCase(),i))},"findAlternatives");var Ep=Object.defineProperty,ri=g((e,t)=>Ep(e,"name",{value:t,configurable:!0}),"r
|
|
131
|
+
`),t.info({message:"Removing "+s.name+" file cache, the cache key is not used anymore.",prefix:"file-cache"}),a=!1}}},"removeOldCacheFolders");var up=Object.defineProperty,fp=g((e,t)=>up(e,"name",{value:t,configurable:!0}),"a$3");const gp=fp((e,t)=>e.some(i=>i instanceof RegExp?i.test(t):i===t),"arrayIncludes");var vp=Object.defineProperty,hp=g((e,t)=>vp(e,"name",{value:t,configurable:!0}),"a$2");const xp=hp((e="")=>{const t=e.split("/");return t[0].startsWith("@")?t[0]+"/"+t[1]:t[0]},"getPackageName");var yp=Object.defineProperty,bp=g((e,t)=>yp(e,"name",{value:t,configurable:!0}),"o$1");const wp=bp(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=xp(n);!gp(e.options.externals,n)&&!n.startsWith("chunks/")&&![...Tt.builtinModules,...Tt.builtinModules.map(s=>`node:${s}`)].includes(a)&&e.pkg?.dependencies?.[a]===void 0&&e.pkg?.peerDependencies?.[a]===void 0&&e.pkg.peerDependenciesMeta?.[a]?.optional!==!0&&o.add(n)}i.size>0&&P(e,`Potential unused dependencies found: ${[...i].map(n=>D(n)).join(", ")}`),o.size>0&&P(e,`Potential implicit dependencies found: ${[...o].map(n=>D(n)).join(", ")}`)},"validateDependencies");var kp=Object.defineProperty,co=g((e,t)=>kp(e,"name",{value:t,configurable:!0}),"i$1");const jp=co((e,t)=>bn(e,t)<=e.length/3||t.includes(e),"isSimilar"),$p=co((e,t)=>{const i=e.toLowerCase();return t.filter(o=>jp(o.toLowerCase(),i))},"findAlternatives");var Ep=Object.defineProperty,ri=g((e,t)=>Ep(e,"name",{value:t,configurable:!0}),"r");const Sp=ri(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?[]:St(e.pkg.exports,e.pkg.type==="module"?"esm":"cjs",t.declaration).map(l=>t.dtsOnly?l.subKey==="types"?l.file:void 0:l.file)].filter(Boolean).map(l=>l&&S(t.rootDir,l.replace(/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,"")))),n=[];for(const l of o)l&&!l.includes("*")&&!gn(l)&&n.push(l.replace(`${t.rootDir}/`,""));const a=ri(l=>_(t.rootDir,S(t.outDir,l)),"rPath"),s=e.buildEntries.filter(l=>!l.chunk).map(l=>a(l.path));if(n.length>0){let l="Potential missing or wrong package.json files:";for(const p of n){const r=$p(p,s);l+=`
|
|
132
132
|
- `+D(p)+(r.length>0?Po` (did you mean ${r.map(c=>`"${c}"`).join(", ")}?)`:"")}P(e,l)}},"validatePackageEntries");var Op=Object.defineProperty,Pp=g((e,t)=>Op(e,"name",{value:t,configurable:!0}),"l$1");const Dp=Pp(e=>{const{options:{validation:t},pkg:i}=e;i.name===void 0&&t?.packageJson?.name!==!1&&P(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),t?.packageJson?.files!==!1&&(i.files===void 0?P(e,"The 'files' field is missing in your package.json. Add the files to be included in the package."):i.files.length===0?P(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))||P(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&&P(e,"The 'main' field is missing in your package.json. This field should point to your main entry file."),i.main?.includes(".mjs")&&P(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&&P(e,"The 'module' field is missing in your package.json, but you are emitting ES modules."),i.module&&i.main&&i.module===i.main&&P(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")&&P(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&&P(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&&P(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&&P(e,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),i.module?.includes(".cjs")&&P(e,"The 'module' field should not use a '.cjs' extension for ES modules."),i.module&&i.main&&i.module===i.main&&P(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&&P(e,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports."))),t?.packageJson?.bin!==!1){if(typeof i.bin=="string"&&i.bin.includes(o?".mjs":".cjs"))P(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")&&P(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&&P(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)&&P(e,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")}},"validatePackageFields");var Cp=Object.defineProperty,Np=g((e,t)=>Cp(e,"name",{value:t,configurable:!0}),"i");const _p=Np(e=>{const{packageJson:t}=lo(e.options.rootDir);e.pkg=t,wp(e),Dp(e),Sp(e)},"validator");var Mp=Object.defineProperty,Tp=g((e,t)=>Mp(e,"name",{value:t,configurable:!0}),"a");const Ip=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,Ap=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"]),li=Tp(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(Ip.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(Ap.has(t))throw new Error(`Alias name "${t}" is a reserved keyword and cannot be used.`);const o=S(i);if(!z(o))throw new Error(`Target path "${o}" for alias "${t}" does not exist.`)}},"validateAliasEntries");var zp=Object.defineProperty,J=g((e,t)=>zp(e,"name",{value:t,configurable:!0}),"c");const Rp=J(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"),Fp=J((e,t,i,o,n,a,s,l,p)=>{const r=Rp(p?.config.compilerOptions?.jsx),c=Mo(a,n,s,{alias:{},browserTargets:_o(),cjsInterop:!1,clean:!0,debug:o,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:o,interopDefault:!0},minify:i===G,name:(l.name??"").split("/").pop()??"default",outDir:p?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!1},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dts:{compilerOptions:{baseUrl:p?.config.compilerOptions?.baseUrl??".",checkJs:!1,composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,moduleResolution:100,noEmit:!1,noEmitOnError:!0,preserveSymlinks:!1,skipLibCheck:!0,target:99},respectExternal:!0},dynamicVars:{errorWhenNoFilesFound:!0,exclude:he,include:/\bimport\s*[(/]/},esbuild:{charset:"utf8",jsx:r,jsxDev:p?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:p?.config.compilerOptions?.jsxFactory,jsxFragment:p?.config.compilerOptions?.jsxFragmentFactory,jsxImportSource:p?.config.compilerOptions?.jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,target:p?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:p?.config},isolatedDeclarations:{exclude:he,ignoreErrors:!1,include:xe},json:{preferConst:!0},license:{dependenciesTemplate:J((m,d,u)=>`
|
|
133
133
|
# Licenses of bundled dependencies
|
|
134
134
|
The published ${u} artifact additionally contains code with the following licenses:
|
|
@@ -177,4 +177,4 @@ ${v}
|
|
|
177
177
|
module.exports = defineConfig({
|
|
178
178
|
transformer${d}
|
|
179
179
|
});
|
|
180
|
-
`}const u=mt(),y=l?"ts":"js";p.length>0&&(u.start("Installing packages"),await dt(p,{cwd:o,dev:!0,silent:!0}),u.stop("Installed packages")),u.start("Creating packem.config."+y),le(j(o,"packem.config."+y),m),u.stop("Created packem.config."+y),bo("Now you can run `packem build` to build your project")},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer",name:"transformer",type:ze(t=>{if(typeof t=="string"&&["esbuild","sucrase","swc"].includes(t))return t;throw new Error("Invalid transformer, please choose one of 'swc', 'sucrase' or 'esbuild'")},"type")},{description:"Choose a isolated declaration transformer",name:"isolated-declaration-transformer",type:ze(t=>{if(typeof t=="string"&&["none","oxc","swc","typescript"].includes(t))return t;throw new Error("Invalid isolated declaration isolated declaration, please choose one of 'none', 'oxc', 'swc' or 'typescript'")},"type")},{description:"Use CSS",name:"css",type:Boolean},{description:"Use CSS minifier",name:"css-minifier",type:Boolean},{Description:"Use TypeScript",name:"typescript",type:Boolean}]})},"createInitCommand")
|
|
180
|
+
`}const u=mt(),y=l?"ts":"js";p.length>0&&(u.start("Installing packages"),await dt(p,{cwd:o,dev:!0,silent:!0}),u.stop("Installed packages")),u.start("Creating packem.config."+y),le(j(o,"packem.config."+y),m),u.stop("Created packem.config."+y),bo("Now you can run `packem build` to build your project")},"execute"),name:"init",options:[{defaultValue:".",description:"The directory to initialize",name:"dir",type:String},{description:"Choose a transformer",name:"transformer",type:ze(t=>{if(typeof t=="string"&&["esbuild","sucrase","swc"].includes(t))return t;throw new Error("Invalid transformer, please choose one of 'swc', 'sucrase' or 'esbuild'")},"type")},{description:"Choose a isolated declaration transformer",name:"isolated-declaration-transformer",type:ze(t=>{if(typeof t=="string"&&["none","oxc","swc","typescript"].includes(t))return t;throw new Error("Invalid isolated declaration isolated declaration, please choose one of 'none', 'oxc', 'swc' or 'typescript'")},"type")},{description:"Use CSS",name:"css",type:Boolean},{description:"Use CSS minifier",name:"css-minifier",type:Boolean},{Description:"Use TypeScript",name:"typescript",type:Boolean}]})},"createInitCommand");try{const{enableCompileCache:e}=require("node:module");e&&e()}catch{}const tt=new fo("packem",{logger:{reporters:[new go({error:{hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0}})],scope:"packem"},packageName:wn,packageVersion:kn});Vp(tt);Wp(tt);On(tt);tt.run({shouldExitProcess:!1});
|