@rspack/core 1.4.7-alpha.0 → 1.4.7-alpha.1

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/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  var __webpack_modules__ = {
3
- "../../node_modules/.pnpm/enhanced-resolve@5.18.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js": function(module, __unused_webpack_exports, __webpack_require__) {
4
- let nextTick = __webpack_require__("process").nextTick, dirname = (path)=>{
3
+ "../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js": function(module, __unused_webpack_exports, __webpack_require__) {
4
+ let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
5
5
  let idx = path.length - 1;
6
6
  for(; idx >= 0;){
7
- let c = path.charCodeAt(idx);
8
- if (47 === c || 92 === c) break;
7
+ let char = path.charCodeAt(idx);
8
+ if (47 === char || 92 === char) break;
9
9
  idx--;
10
10
  }
11
11
  return idx < 0 ? "" : path.slice(0, idx);
@@ -17,8 +17,8 @@ var __webpack_modules__ = {
17
17
  }
18
18
  for (let callback of callbacks)try {
19
19
  callback(err, result);
20
- } catch (e) {
21
- error || (error = e);
20
+ } catch (err) {
21
+ error || (error = err);
22
22
  }
23
23
  if (callbacks.length = 0, error) throw error;
24
24
  };
@@ -182,13 +182,13 @@ var __webpack_modules__ = {
182
182
  if (err) return callback(err);
183
183
  if (!buffer || 0 === buffer.length) return callback(Error("No file content"));
184
184
  try {
185
- data = JSON.parse(buffer.toString("utf-8"));
186
- } catch (e) {
187
- return callback(e);
185
+ data = JSON.parse(buffer.toString("utf8"));
186
+ } catch (err_) {
187
+ return callback(err_);
188
188
  }
189
189
  callback(null, data);
190
190
  });
191
- }), this.fileSystem.readJsonSync || this.readFileSync && ((path)=>JSON.parse(this.readFileSync(path).toString("utf-8"))), this.fileSystem);
191
+ }), this.fileSystem.readJsonSync || this.readFileSync && ((path)=>JSON.parse(this.readFileSync(path).toString("utf8"))), this.fileSystem);
192
192
  let readJson = this._readJsonBackend.provide;
193
193
  this.readJson = readJson;
194
194
  let readJsonSync = this._readJsonBackend.provideSync;
@@ -432,12 +432,12 @@ for(var __webpack_i__ in (()=>{
432
432
  webworker: ()=>webworker
433
433
  });
434
434
  var binding_ = __webpack_require__("@rspack/binding"), binding_default = __webpack_require__.n(binding_);
435
- let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), cutOffByFlag = (stack, flag)=>{
436
- let stacks = stack.split("\n");
437
- for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
438
- return stacks.join("\n");
439
- }, cutOffLoaderExecution = (stack)=>cutOffByFlag(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
440
- let details = cutOffLoaderExecution(stack);
435
+ let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), cutOffLoaderExecution = (stack)=>((stack, flag)=>{
436
+ let stacks = stack.split("\n");
437
+ for(let i = 0; i < stacks.length; i++)stacks[i].includes(flag) && (stacks.length = i);
438
+ return stacks.join("\n");
439
+ })(stack, "LOADER_EXECUTION"), cleanUp = (stack, name, message)=>{
440
+ cutOffLoaderExecution(stack);
441
441
  return cutOffMessage(stack, name, message);
442
442
  }, cutOffMessage = (stack, name, message)=>{
443
443
  let nextLine = stack.indexOf("\n");
@@ -632,7 +632,7 @@ for(var __webpack_i__ in (()=>{
632
632
  case "verbose":
633
633
  return {
634
634
  all: !0,
635
- modulesSpace: Number.POSITIVE_INFINITY
635
+ modulesSpace: 1 / 0
636
636
  };
637
637
  case "errors-only":
638
638
  return {
@@ -826,76 +826,7 @@ for(var __webpack_i__ in (()=>{
826
826
  return null != aValue ? null != bValue ? comparator(aValue, bValue) : -1 : +(null != bValue);
827
827
  };
828
828
  return compareSelectCache.set(getter, comparator, result), result;
829
- }, compareNumbers = (a, b)=>typeof a != typeof b ? typeof a < typeof b ? -1 : 1 : a < b ? -1 : +(a > b), smartGrouping = (items, groupConfigs)=>{
830
- let itemsWithGroups = new Set(), allGroups = new Map();
831
- for (let item of items){
832
- let groups = new Set();
833
- for(let i = 0; i < groupConfigs.length; i++){
834
- let groupConfig = groupConfigs[i], keys = groupConfig.getKeys(item);
835
- if (keys) for (let name of keys){
836
- let key = `${i}:${name}`, group = allGroups.get(key);
837
- void 0 === group && allGroups.set(key, group = {
838
- config: groupConfig,
839
- name,
840
- alreadyGrouped: !1,
841
- items: void 0
842
- }), groups.add(group);
843
- }
844
- }
845
- itemsWithGroups.add({
846
- item,
847
- groups
848
- });
849
- }
850
- let runGrouping = (itemsWithGroups)=>{
851
- let totalSize = itemsWithGroups.size;
852
- for (let entry of itemsWithGroups)for (let group of entry.groups){
853
- if (group.alreadyGrouped) continue;
854
- let items = group.items;
855
- void 0 === items ? group.items = new Set([
856
- entry
857
- ]) : items.add(entry);
858
- }
859
- let groupMap = new Map();
860
- for (let group of allGroups.values())if (group.items) {
861
- let items = group.items;
862
- group.items = void 0, groupMap.set(group, {
863
- items,
864
- options: void 0,
865
- used: !1
866
- });
867
- }
868
- let results = [];
869
- for(;;){
870
- let bestGroup, bestGroupItems, bestGroupOptions, bestGroupSize = -1;
871
- for (let [group, state] of groupMap){
872
- let { items, used } = state, options = state.options;
873
- if (void 0 === options) {
874
- let groupConfig = group.config;
875
- state.options = options = groupConfig.getOptions?.(group.name, Array.from(items, ({ item })=>item)) || !1;
876
- }
877
- let force = !1 !== options && options.force;
878
- if (!force && (!1 !== bestGroupOptions && bestGroupOptions?.force || used || items.size <= 1 || totalSize - items.size <= 1)) continue;
879
- let targetGroupCount = !1 !== options && options.targetGroupCount || 4, sizeValue = force ? items.size : Math.min(items.size, 2 * totalSize / targetGroupCount + itemsWithGroups.size - items.size);
880
- (sizeValue > bestGroupSize || force && (!bestGroupOptions || !bestGroupOptions.force)) && (bestGroup = group, bestGroupSize = sizeValue, bestGroupItems = items, bestGroupOptions = options);
881
- }
882
- if (void 0 === bestGroup) break;
883
- let items = new Set(bestGroupItems), options = bestGroupOptions, groupChildren = !options || !1 !== options.groupChildren;
884
- for (let item of items)for (let group of (itemsWithGroups.delete(item), item.groups)){
885
- let state = groupMap.get(group);
886
- void 0 !== state && (state.items.delete(item), 0 === state.items.size ? groupMap.delete(group) : (state.options = void 0, groupChildren && (state.used = !0)));
887
- }
888
- groupMap.delete(bestGroup);
889
- let key = bestGroup.name, groupConfig = bestGroup.config, allItems = Array.from(items, ({ item })=>item);
890
- bestGroup.alreadyGrouped = !0;
891
- let children = groupChildren ? runGrouping(items) : allItems;
892
- bestGroup.alreadyGrouped = !1, results.push(groupConfig.createGroup(key, children, allItems));
893
- }
894
- for (let { item } of itemsWithGroups)results.push(item);
895
- return results;
896
- };
897
- return runGrouping(itemsWithGroups);
898
- };
829
+ }, compareNumbers = (a, b)=>typeof a != typeof b ? typeof a < typeof b ? -1 : 1 : a < b ? -1 : +(a > b);
899
830
  class StatsFactory {
900
831
  hooks;
901
832
  _caches;
@@ -1018,7 +949,76 @@ for(var __webpack_i__ in (()=>{
1018
949
  }), comparators2 = [];
1019
950
  this._forEachLevel(this.hooks.sortResults, this._caches.sortResults, type, (h)=>h.call(comparators2, context)), comparators2.length > 0 && resultItems.sort(concatComparators(...comparators2));
1020
951
  let groupConfigs = [];
1021
- this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems = smartGrouping(resultItems, groupConfigs));
952
+ this._forEachLevel(this.hooks.groupResults, this._caches.groupResults, type, (h)=>h.call(groupConfigs, context)), groupConfigs.length > 0 && (resultItems = ((items, groupConfigs)=>{
953
+ let itemsWithGroups = new Set(), allGroups = new Map();
954
+ for (let item of items){
955
+ let groups = new Set();
956
+ for(let i = 0; i < groupConfigs.length; i++){
957
+ let groupConfig = groupConfigs[i], keys = groupConfig.getKeys(item);
958
+ if (keys) for (let name of keys){
959
+ let key = `${i}:${name}`, group = allGroups.get(key);
960
+ void 0 === group && allGroups.set(key, group = {
961
+ config: groupConfig,
962
+ name,
963
+ alreadyGrouped: !1,
964
+ items: void 0
965
+ }), groups.add(group);
966
+ }
967
+ }
968
+ itemsWithGroups.add({
969
+ item,
970
+ groups
971
+ });
972
+ }
973
+ let runGrouping = (itemsWithGroups)=>{
974
+ let totalSize = itemsWithGroups.size;
975
+ for (let entry of itemsWithGroups)for (let group of entry.groups){
976
+ if (group.alreadyGrouped) continue;
977
+ let items = group.items;
978
+ void 0 === items ? group.items = new Set([
979
+ entry
980
+ ]) : items.add(entry);
981
+ }
982
+ let groupMap = new Map();
983
+ for (let group of allGroups.values())if (group.items) {
984
+ let items = group.items;
985
+ group.items = void 0, groupMap.set(group, {
986
+ items,
987
+ options: void 0,
988
+ used: !1
989
+ });
990
+ }
991
+ let results = [];
992
+ for(;;){
993
+ let bestGroup, bestGroupItems, bestGroupOptions, bestGroupSize = -1;
994
+ for (let [group, state] of groupMap){
995
+ let { items, used } = state, options = state.options;
996
+ if (void 0 === options) {
997
+ let groupConfig = group.config;
998
+ state.options = options = groupConfig.getOptions?.(group.name, Array.from(items, ({ item })=>item)) || !1;
999
+ }
1000
+ let force = !1 !== options && options.force;
1001
+ if (!force && (!1 !== bestGroupOptions && bestGroupOptions?.force || used || items.size <= 1 || totalSize - items.size <= 1)) continue;
1002
+ let targetGroupCount = !1 !== options && options.targetGroupCount || 4, sizeValue = force ? items.size : Math.min(items.size, 2 * totalSize / targetGroupCount + itemsWithGroups.size - items.size);
1003
+ (sizeValue > bestGroupSize || force && (!bestGroupOptions || !bestGroupOptions.force)) && (bestGroup = group, bestGroupSize = sizeValue, bestGroupItems = items, bestGroupOptions = options);
1004
+ }
1005
+ if (void 0 === bestGroup) break;
1006
+ let items = new Set(bestGroupItems), options = bestGroupOptions, groupChildren = !options || !1 !== options.groupChildren;
1007
+ for (let item of items)for (let group of (itemsWithGroups.delete(item), item.groups)){
1008
+ let state = groupMap.get(group);
1009
+ void 0 !== state && (state.items.delete(item), 0 === state.items.size ? groupMap.delete(group) : (state.options = void 0, groupChildren && (state.used = !0)));
1010
+ }
1011
+ groupMap.delete(bestGroup);
1012
+ let key = bestGroup.name, groupConfig = bestGroup.config, allItems = Array.from(items, ({ item })=>item);
1013
+ bestGroup.alreadyGrouped = !0;
1014
+ let children = groupChildren ? runGrouping(items) : allItems;
1015
+ bestGroup.alreadyGrouped = !1, results.push(groupConfig.createGroup(key, children, allItems));
1016
+ }
1017
+ for (let { item } of itemsWithGroups)results.push(item);
1018
+ return results;
1019
+ };
1020
+ return runGrouping(itemsWithGroups);
1021
+ })(resultItems, groupConfigs));
1022
1022
  let finalResultItems = this._forEachLevelFilter(this.hooks.filterResults, this._caches.filterResults, type, resultItems, (h, r, idx, i)=>h.call(r, context, idx, i), !1), result = this._forEachLevel(this.hooks.merge, this._caches.merge, type, (h)=>h.call(finalResultItems, context));
1023
1023
  return void 0 === result && (result = finalResultItems), this._forEachLevelWaterfall(this.hooks.result, this._caches.result, type, result, (h, r)=>h.call(r, context));
1024
1024
  }
@@ -1974,22 +1974,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1974
1974
  super(error.message), this.name = "HookWebpackError", this.hook = hook, this.error = error, this.hideStack = !0, this.details = `caused by plugins in ${hook}\n${error.stack}`, this.stack += `\n-- inner error --\n${error.stack}`;
1975
1975
  }
1976
1976
  }
1977
- let makeWebpackError = (error, hook)=>error instanceof WebpackError ? error : new HookWebpackError(error, hook), makeWebpackErrorCallback = (callback, hook)=>(err, result)=>{
1977
+ let makeWebpackErrorCallback = (callback, hook)=>(err, result)=>{
1978
1978
  if (err) return err instanceof WebpackError ? void callback(err) : void callback(new HookWebpackError(err, hook));
1979
1979
  callback(null, result);
1980
- }, tryRunOrWebpackError = (fn, hook)=>{
1981
- let r;
1982
- try {
1983
- r = fn();
1984
- } catch (err) {
1985
- if (err instanceof WebpackError) throw err;
1986
- throw new HookWebpackError(err, hook);
1987
- }
1988
- return r;
1989
- }, needCalls = (times, callback)=>{
1990
- let leftTimes = times;
1991
- return (err)=>0 == --leftTimes ? callback() : err && leftTimes > 0 ? (leftTimes = 0, callback()) : void 0;
1992
- };
1980
+ };
1993
1981
  class Cache {
1994
1982
  static STAGE_DISK = 10;
1995
1983
  static STAGE_MEMORY = -10;
@@ -2019,10 +2007,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2019
2007
  get(identifier, etag, callback) {
2020
2008
  let gotHandlers = [];
2021
2009
  this.hooks.get.callAsync(identifier, etag, gotHandlers, (err, res)=>{
2022
- if (err) return void callback(makeWebpackError(err, "Cache.hooks.get"));
2010
+ var error, hook, times, callback1;
2011
+ if (err) return void callback((hook = "Cache.hooks.get", (error = err) instanceof WebpackError ? error : new HookWebpackError(error, hook)));
2023
2012
  let result = res;
2024
2013
  if (null === result && (result = void 0), gotHandlers.length > 1) {
2025
- let innerCallback = needCalls(gotHandlers.length, ()=>callback(null, result));
2014
+ let leftTimes, innerCallback = (times = gotHandlers.length, callback1 = ()=>callback(null, result), leftTimes = times, (err)=>0 == --leftTimes ? callback1() : err && leftTimes > 0 ? (leftTimes = 0, callback1()) : void 0);
2026
2015
  for (let gotHandler of gotHandlers)gotHandler(result, innerCallback);
2027
2016
  } else 1 === gotHandlers.length ? gotHandlers[0](result, ()=>callback(null, result)) : callback(null, result);
2028
2017
  });
@@ -2151,18 +2140,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2151
2140
  return old.reset(), old;
2152
2141
  }
2153
2142
  return new WasmHash(new WebAssembly.Instance(wasmModule), instancesPool, chunkSize, digestSize);
2154
- }, hash_md4 = ()=>{
2155
- if (!createMd4) {
2156
- let md4 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiAKc3EgAnMgA2pqQQt3IgwgCiALc3EgCnMgAmpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IgogDCANc3EgDHMgC2pqQQd3IgsgCiANc3EgDXMgDGpqQQt3IgwgCiALc3EgCnMgDWpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IhQgDCANc3EgDHMgC2pqQQd3IRUgASgCLCILIAEoAigiCiAMIA0gDSAUcyAVcXNqakELdyIWIBQgFXNxIBRzIA1qakETdyEXIAEoAjQiGCABKAIwIhkgFSAWcyAXcSAVcyAUampBA3ciFCAWIBdzcSAWcyAVampBB3chFSABKAI8Ig0gASgCOCIMIBQgF3MgFXEgF3MgFmpqQQt3IhYgFCAVc3EgFHMgF2pqQRN3IRcgEyAOIBEgFCAVIBZyIBdxIBUgFnFyampBmfOJ1AVqQQN3IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEFdyIVIBQgF3JxIBQgF3FyIBZqakGZ84nUBWpBCXchFiAPIBggEiAWIAcgFSAQIBQgGSAUIBVyIBZxIBQgFXFyIBdqakGZ84nUBWpBDXciFCAVIBZycSAVIBZxcmpqQZnzidQFakEDdyIVIBQgFnJxIBQgFnFyampBmfOJ1AVqQQV3IhcgFCAVcnEgFCAVcXJqakGZ84nUBWpBCXciFiAVIBdycSAVIBdxciAUampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEDdyEVIBEgBiAVIAwgFCAKIBYgCCAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFyAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIWIBUgF3JxIBUgF3FyampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXJqakGZ84nUBWpBA3ciFSALIBYgCSAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFiAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIXIA0gFSAWciAXcSAVIBZxciAUampBmfOJ1AVqQQ13IhRzIBZzampBodfn9gZqQQN3IREgByAIIA4gFCARIBcgESAUc3MgFmogE2pBodfn9gZqQQl3IhNzcyAXampBodfn9gZqQQt3Ig4gDyARIBMgDiARIA4gE3NzIBRqIBlqQaHX5/YGakEPdyIRc3NqakGh1+f2BmpBA3ciDyAOIA8gEXNzIBNqIApqQaHX5/YGakEJdyIKcyARc2pqQaHX5/YGakELdyIIIBAgDyAKIAggDCAPIAggCnNzIBFqakGh1+f2BmpBD3ciDHNzampBodfn9gZqQQN3Ig4gEiAIIAwgDnNzIApqakGh1+f2BmpBCXciCHMgDHNqakGh1+f2BmpBC3chByAFIAYgCCAHIBggDiAHIAhzcyAMampBodfn9gZqQQ93IgpzcyAOampBodfn9gZqQQN3IgZqIQUgDSAGIAkgByAGIAsgByAGIApzcyAIampBodfn9gZqQQl3IgdzIApzampBodfn9gZqQQt3IgYgB3NzIApqakGh1+f2BmpBD3cgAmohAiADIAZqIQMgBCAHaiEEIAFBQGshAQwBCwsgBSQBIAIkAiADJAMgBCQECw0AIAAQASAAIwBqJAAL/wQCA38BfiAAIwBqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64"));
2157
- createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
2158
- }
2159
- return createMd4();
2160
- }, hash_xxhash64 = ()=>{
2161
- if (!createXxhash64) {
2162
- let xxhash64 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64"));
2163
- createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
2164
- }
2165
- return createXxhash64();
2166
2143
  }, digestCaches = {};
2167
2144
  class BulkUpdateDecorator extends Hash {
2168
2145
  hash;
@@ -2221,9 +2198,21 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2221
2198
  case "debug":
2222
2199
  return new DebugHash();
2223
2200
  case "xxhash64":
2224
- return new WasmHashAdapter(hash_xxhash64());
2201
+ return new WasmHashAdapter((()=>{
2202
+ if (!createXxhash64) {
2203
+ let xxhash64 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAAgAUEgaiIBSw0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", "base64"));
2204
+ createXxhash64 = wasm_hash.bind(null, xxhash64, [], 32, 16);
2205
+ }
2206
+ return createXxhash64();
2207
+ })());
2225
2208
  case "md4":
2226
- return new WasmHashAdapter(hash_md4());
2209
+ return new WasmHashAdapter((()=>{
2210
+ if (!createMd4) {
2211
+ let md4 = new WebAssembly.Module(Buffer.from("AGFzbQEAAAABCAJgAX8AYAAAAwUEAQAAAAUDAQABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwciBARpbml0AAAGdXBkYXRlAAIFZmluYWwAAwZtZW1vcnkCAAqLEAQmAEGBxpS6BiQBQYnXtv5+JAJB/rnrxXkkA0H2qMmBASQEQQAkAAvSCgEZfyMBIQUjAiECIwMhAyMEIQQDQCAAIAFLBEAgASgCJCISIAEoAiAiEyABKAIcIgkgASgCGCIIIAEoAhQiByABKAIQIg4gASgCDCIGIAEoAggiDyABKAIEIhAgASgCACIRIAMgBHMgAnEgBHMgBWpqQQN3IgogAiADc3EgA3MgBGpqQQd3IgsgAiAKc3EgAnMgA2pqQQt3IgwgCiALc3EgCnMgAmpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IgogDCANc3EgDHMgC2pqQQd3IgsgCiANc3EgDXMgDGpqQQt3IgwgCiALc3EgCnMgDWpqQRN3Ig0gCyAMc3EgC3MgCmpqQQN3IhQgDCANc3EgDHMgC2pqQQd3IRUgASgCLCILIAEoAigiCiAMIA0gDSAUcyAVcXNqakELdyIWIBQgFXNxIBRzIA1qakETdyEXIAEoAjQiGCABKAIwIhkgFSAWcyAXcSAVcyAUampBA3ciFCAWIBdzcSAWcyAVampBB3chFSABKAI8Ig0gASgCOCIMIBQgF3MgFXEgF3MgFmpqQQt3IhYgFCAVc3EgFHMgF2pqQRN3IRcgEyAOIBEgFCAVIBZyIBdxIBUgFnFyampBmfOJ1AVqQQN3IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEFdyIVIBQgF3JxIBQgF3FyIBZqakGZ84nUBWpBCXchFiAPIBggEiAWIAcgFSAQIBQgGSAUIBVyIBZxIBQgFXFyIBdqakGZ84nUBWpBDXciFCAVIBZycSAVIBZxcmpqQZnzidQFakEDdyIVIBQgFnJxIBQgFnFyampBmfOJ1AVqQQV3IhcgFCAVcnEgFCAVcXJqakGZ84nUBWpBCXciFiAVIBdycSAVIBdxciAUampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXIgFWpqQZnzidQFakEDdyEVIBEgBiAVIAwgFCAKIBYgCCAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFyAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIWIBUgF3JxIBUgF3FyampBmfOJ1AVqQQ13IhQgFiAXcnEgFiAXcXJqakGZ84nUBWpBA3ciFSALIBYgCSAUIBZyIBVxIBQgFnFyIBdqakGZ84nUBWpBBXciFiAUIBVycSAUIBVxcmpqQZnzidQFakEJdyIXIA0gFSAWciAXcSAVIBZxciAUampBmfOJ1AVqQQ13IhRzIBZzampBodfn9gZqQQN3IREgByAIIA4gFCARIBcgESAUc3MgFmogE2pBodfn9gZqQQl3IhNzcyAXampBodfn9gZqQQt3Ig4gDyARIBMgDiARIA4gE3NzIBRqIBlqQaHX5/YGakEPdyIRc3NqakGh1+f2BmpBA3ciDyAOIA8gEXNzIBNqIApqQaHX5/YGakEJdyIKcyARc2pqQaHX5/YGakELdyIIIBAgDyAKIAggDCAPIAggCnNzIBFqakGh1+f2BmpBD3ciDHNzampBodfn9gZqQQN3Ig4gEiAIIAwgDnNzIApqakGh1+f2BmpBCXciCHMgDHNqakGh1+f2BmpBC3chByAFIAYgCCAHIBggDiAHIAhzcyAMampBodfn9gZqQQ93IgpzcyAOampBodfn9gZqQQN3IgZqIQUgDSAGIAkgByAGIAsgByAGIApzcyAIampBodfn9gZqQQl3IgdzIApzampBodfn9gZqQQt3IgYgB3NzIApqakGh1+f2BmpBD3cgAmohAiADIAZqIQMgBCAHaiEEIAFBQGshAQwBCwsgBSQBIAIkAiADJAMgBCQECw0AIAAQASAAIwBqJAAL/wQCA38BfiAAIwBqrUIDhiEEIABByABqQUBxIgJBCGshAyAAIgFBAWohACABQYABOgAAA0AgACACSUEAIABBB3EbBEAgAEEAOgAAIABBAWohAAwBCwsDQCAAIAJJBEAgAEIANwMAIABBCGohAAwBCwsgAyAENwMAIAIQAUEAIwGtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIwKtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEQIwOtIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEYIwStIgRC//8DgyAEQoCA/P8Pg0IQhoQiBEL/gYCA8B+DIARCgP6DgIDgP4NCCIaEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAAs=", "base64"));
2212
+ createMd4 = wasm_hash.bind(null, md4, [], 64, 32);
2213
+ }
2214
+ return createMd4();
2215
+ })());
2227
2216
  case "native-md4":
2228
2217
  return new BulkUpdateDecorator(()=>external_node_crypto_default().createHash("md4"), "md4");
2229
2218
  default:
@@ -2245,22 +2234,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2245
2234
  return this._hash;
2246
2235
  }
2247
2236
  }
2248
- let mapStrings = new Map(), mapObjects = new WeakMap(), getLazyHashedEtag_getter = (obj, hashFunction = "xxhash64")=>{
2249
- let innerMap;
2250
- if ("string" == typeof hashFunction) {
2251
- if (void 0 === (innerMap = mapStrings.get(hashFunction))) {
2252
- let newHash = new LazyHashedEtag(obj, hashFunction);
2253
- return (innerMap = new WeakMap()).set(obj, newHash), mapStrings.set(hashFunction, innerMap), newHash;
2254
- }
2255
- } else if (void 0 === (innerMap = mapObjects.get(hashFunction))) {
2256
- let newHash = new LazyHashedEtag(obj, hashFunction);
2257
- return (innerMap = new WeakMap()).set(obj, newHash), mapObjects.set(hashFunction, innerMap), newHash;
2258
- }
2259
- let hash = innerMap.get(obj);
2260
- if (void 0 !== hash) return hash;
2261
- let newHash = new LazyHashedEtag(obj, hashFunction);
2262
- return innerMap.set(obj, newHash), newHash;
2263
- };
2237
+ let mapStrings = new Map(), mapObjects = new WeakMap();
2264
2238
  class MergedEtag {
2265
2239
  a;
2266
2240
  b;
@@ -2271,31 +2245,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2271
2245
  return `${this.a.toString()}|${this.b.toString()}`;
2272
2246
  }
2273
2247
  }
2274
- let dualObjectMap = new WeakMap(), objectStringMap = new WeakMap(), mergeEtags = (first, second)=>{
2275
- let a = first, b = second;
2276
- if ("string" == typeof a) {
2277
- if ("string" == typeof b) return `${a}|${b}`;
2278
- let temp = b;
2279
- b = a, a = temp;
2280
- } else if ("string" != typeof b) {
2281
- let map = dualObjectMap.get(a);
2282
- void 0 === map && dualObjectMap.set(a, map = new WeakMap());
2283
- let mergedEtag = map.get(b);
2284
- if (void 0 === mergedEtag) {
2285
- let newMergedEtag = new MergedEtag(a, b);
2286
- return map.set(b, newMergedEtag), newMergedEtag;
2287
- }
2288
- return mergedEtag;
2289
- }
2290
- let map = objectStringMap.get(a);
2291
- void 0 === map && objectStringMap.set(a, map = new Map());
2292
- let mergedEtag = map.get(b);
2293
- if (void 0 === mergedEtag) {
2294
- let newMergedEtag = new MergedEtag(a, b);
2295
- return map.set(b, newMergedEtag), newMergedEtag;
2296
- }
2297
- return mergedEtag;
2298
- };
2248
+ let dualObjectMap = new WeakMap(), objectStringMap = new WeakMap();
2299
2249
  class ItemCacheFacade {
2300
2250
  _cache;
2301
2251
  _name;
@@ -2353,10 +2303,49 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2353
2303
  return new ItemCacheFacade(this._cache, `${this._name}|${identifier}`, etag);
2354
2304
  }
2355
2305
  getLazyHashedEtag(obj) {
2356
- return getLazyHashedEtag_getter(obj, this._hashFunction);
2306
+ return ((obj, hashFunction = "xxhash64")=>{
2307
+ let innerMap;
2308
+ if ("string" == typeof hashFunction) {
2309
+ if (void 0 === (innerMap = mapStrings.get(hashFunction))) {
2310
+ let newHash = new LazyHashedEtag(obj, hashFunction);
2311
+ return (innerMap = new WeakMap()).set(obj, newHash), mapStrings.set(hashFunction, innerMap), newHash;
2312
+ }
2313
+ } else if (void 0 === (innerMap = mapObjects.get(hashFunction))) {
2314
+ let newHash = new LazyHashedEtag(obj, hashFunction);
2315
+ return (innerMap = new WeakMap()).set(obj, newHash), mapObjects.set(hashFunction, innerMap), newHash;
2316
+ }
2317
+ let hash = innerMap.get(obj);
2318
+ if (void 0 !== hash) return hash;
2319
+ let newHash = new LazyHashedEtag(obj, hashFunction);
2320
+ return innerMap.set(obj, newHash), newHash;
2321
+ })(obj, this._hashFunction);
2357
2322
  }
2358
2323
  mergeEtags(a, b) {
2359
- return mergeEtags(a, b);
2324
+ return ((first, second)=>{
2325
+ let a = first, b = second;
2326
+ if ("string" == typeof a) {
2327
+ if ("string" == typeof b) return `${a}|${b}`;
2328
+ let temp = b;
2329
+ b = a, a = temp;
2330
+ } else if ("string" != typeof b) {
2331
+ let map = dualObjectMap.get(a);
2332
+ void 0 === map && dualObjectMap.set(a, map = new WeakMap());
2333
+ let mergedEtag = map.get(b);
2334
+ if (void 0 === mergedEtag) {
2335
+ let newMergedEtag = new MergedEtag(a, b);
2336
+ return map.set(b, newMergedEtag), newMergedEtag;
2337
+ }
2338
+ return mergedEtag;
2339
+ }
2340
+ let map = objectStringMap.get(a);
2341
+ void 0 === map && objectStringMap.set(a, map = new Map());
2342
+ let mergedEtag = map.get(b);
2343
+ if (void 0 === mergedEtag) {
2344
+ let newMergedEtag = new MergedEtag(a, b);
2345
+ return map.set(b, newMergedEtag), newMergedEtag;
2346
+ }
2347
+ return mergedEtag;
2348
+ })(a, b);
2360
2349
  }
2361
2350
  get(identifier, etag, callback) {
2362
2351
  this._cache.get(`${this._name}|${identifier}`, etag, callback);
@@ -2416,16 +2405,16 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2416
2405
  if (external_node_path_default().posix.isAbsolute(rootPath)) return external_node_path_default().posix.join(rootPath, filename);
2417
2406
  if (external_node_path_default().win32.isAbsolute(rootPath)) return external_node_path_default().win32.join(rootPath, filename);
2418
2407
  throw Error(`${rootPath} is neither a posix nor a windows path, and there is no 'join' method defined in the file system`);
2419
- }, dirname = (fs, absPath)=>{
2420
- if (fs?.dirname) return fs.dirname(absPath);
2421
- if (external_node_path_default().posix.isAbsolute(absPath)) return external_node_path_default().posix.dirname(absPath);
2422
- if (external_node_path_default().win32.isAbsolute(absPath)) return external_node_path_default().win32.dirname(absPath);
2423
- throw Error(`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`);
2424
2408
  }, mkdirp = (fs, p, callback)=>{
2425
2409
  fs.mkdir(p, (err)=>{
2426
2410
  if (err) {
2427
2411
  if ("ENOENT" === err.code) {
2428
- let dir = dirname(fs, p);
2412
+ let dir = ((fs, absPath)=>{
2413
+ if (fs?.dirname) return fs.dirname(absPath);
2414
+ if (external_node_path_default().posix.isAbsolute(absPath)) return external_node_path_default().posix.dirname(absPath);
2415
+ if (external_node_path_default().win32.isAbsolute(absPath)) return external_node_path_default().win32.dirname(absPath);
2416
+ throw Error(`${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`);
2417
+ })(fs, p);
2429
2418
  return dir === p ? void callback(err) : void mkdirp(fs, dir, (err)=>{
2430
2419
  if (err) return void callback(err);
2431
2420
  fs.mkdir(p, (err)=>{
@@ -2679,6 +2668,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2679
2668
  if (bufLike instanceof Uint8Array) return Buffer.from(bufLike.buffer);
2680
2669
  throw Error("Buffer, Uint8Array or string expected");
2681
2670
  };
2671
+ function serializeObject(map) {
2672
+ if (!isNil(map)) return "string" == typeof map ? map ? toBuffer(map) : void 0 : toBuffer(JSON.stringify(map));
2673
+ }
2682
2674
  function stringifyLoaderObject(o) {
2683
2675
  return o.path + o.query + o.fragment;
2684
2676
  }
@@ -2696,7 +2688,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2696
2688
  return resource = external_node_path_default().win32.relative(context, resource), WINDOWS_ABS_PATH_REGEXP.test(resource) || (resource = relativePathToRequest(resource.replace(WINDOWS_PATH_SEPARATOR_REGEXP, "/"))), -1 === querySplitPos ? resource : resource + maybeAbsolutePath.slice(querySplitPos);
2697
2689
  }
2698
2690
  return maybeAbsolutePath;
2699
- }, requestToAbsolute = (context, relativePath)=>relativePath.startsWith("./") || relativePath.startsWith("../") ? external_node_path_default().join(context, relativePath) : relativePath, makeCacheable = (realFn)=>{
2691
+ }, makeCacheable = (realFn)=>{
2700
2692
  let cache = new WeakMap(), getCache = (associatedObjectForCache)=>{
2701
2693
  let entry = cache.get(associatedObjectForCache);
2702
2694
  if (void 0 !== entry) return entry;
@@ -2750,7 +2742,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2750
2742
  return innerSubCache?.set(identifier, result), result;
2751
2743
  };
2752
2744
  }, cachedFn;
2753
- }, makePathsRelative = makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join("")), contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>requestToAbsolute(context, r)).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/, parseResource = makeCacheable((str)=>{
2745
+ }, makePathsRelative = makeCacheableWithContext((context, identifier)=>identifier.split(SEGMENTS_SPLIT_REGEXP).map((str)=>absoluteToRequest(context, str)).join("")), contextify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>absoluteToRequest(context, r)).join("!")), absolutify = makeCacheableWithContext((context, request)=>request.split("!").map((r)=>{
2746
+ var context1, relativePath;
2747
+ return context1 = context, (relativePath = r).startsWith("./") || relativePath.startsWith("../") ? external_node_path_default().join(context1, relativePath) : relativePath;
2748
+ }).join("!")), PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/, PATH_QUERY_REGEXP = /^((?:\u200b.|[^?\u200b])*)(\?.*)?$/, parseResource = makeCacheable((str)=>{
2754
2749
  let match = PATH_QUERY_FRAGMENT_REGEXP.exec(str);
2755
2750
  return {
2756
2751
  resource: str,
@@ -2905,9 +2900,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2905
2900
  "contextDependencies",
2906
2901
  "missingDependencies",
2907
2902
  "buildDependencies"
2908
- ]), commitCustomFieldsToRust = (buildInfo)=>{
2909
- Object.keys(buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[binding_.COMMIT_CUSTOM_FIELDS_SYMBOL]();
2910
- };
2903
+ ]);
2911
2904
  Object.defineProperty(binding_.NormalModule.prototype, "identifier", {
2912
2905
  enumerable: !0,
2913
2906
  configurable: !0,
@@ -2928,9 +2921,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2928
2921
  return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
2929
2922
  }
2930
2923
  });
2931
- let createFakeHook = (fakeHook, message, code)=>Object.freeze(Object.assign(message && code ? deprecateAllProperties(fakeHook, message, code) : fakeHook, {
2932
- _fakeHook: !0
2933
- })), deprecateAllProperties = (obj, message, code)=>{
2924
+ let deprecateAllProperties = (obj, message, code)=>{
2934
2925
  let newObj = {}, descriptors = Object.getOwnPropertyDescriptors(obj);
2935
2926
  for (let name of Object.keys(descriptors)){
2936
2927
  let descriptor = descriptors[name];
@@ -2967,12 +2958,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
2967
2958
  "module"
2968
2959
  ]),
2969
2960
  readResourceForScheme: new lite_tapable_namespaceObject.HookMap((scheme)=>{
2970
- let hook = hooks.readResource.for(scheme);
2971
- return createFakeHook({
2961
+ let fakeHook, message, code, hook = hooks.readResource.for(scheme);
2962
+ return fakeHook = {
2972
2963
  tap: (options, fn)=>hook.tap(options, (loaderContext)=>fn(loaderContext.resource)),
2973
2964
  tapAsync: (options, fn)=>hook.tapAsync(options, (loaderContext, callback)=>fn(loaderContext.resource, callback)),
2974
2965
  tapPromise: (options, fn)=>hook.tapPromise(options, (loaderContext)=>fn(loaderContext.resource))
2975
- });
2966
+ }, Object.freeze(Object.assign(message && code ? deprecateAllProperties(fakeHook, message, code) : fakeHook, {
2967
+ _fakeHook: !0
2968
+ }));
2976
2969
  }),
2977
2970
  readResource: new lite_tapable_namespaceObject.HookMap(()=>new lite_tapable_namespaceObject.AsyncSeriesBailHook([
2978
2971
  "loaderContext"
@@ -3010,55 +3003,53 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3010
3003
  }
3011
3004
  static async cleanupJavaScriptTrace() {
3012
3005
  if ("uninitialized" === this.state) throw Error("JavaScriptTracer is not initialized, please call initJavaScriptTrace first");
3013
- if (!this.layer || "off" === this.state) return;
3014
- let profileHandler = (err, param)=>{
3015
- let cpu_profile;
3016
- if (err ? console.error("Error stopping profiler:", err) : cpu_profile = param.profile, cpu_profile) {
3017
- let uuid = this.uuid();
3018
- this.pushEvent({
3019
- name: "Profile",
3020
- ph: "P",
3021
- trackName: "JavaScript CPU Profiler",
3022
- processName: "JavaScript CPU",
3023
- uuid,
3024
- ...this.getCommonEv(),
3025
- categories: [
3026
- "disabled-by-default-v8.cpu_profiler"
3027
- ],
3028
- args: {
3029
- data: {
3030
- startTime: 0
3031
- }
3032
- }
3033
- }), this.pushEvent({
3034
- name: "ProfileChunk",
3035
- ph: "P",
3036
- trackName: "JavaScript CPU Profiler",
3037
- processName: "JavaScript CPU",
3038
- ...this.getCommonEv(),
3039
- categories: [
3040
- "disabled-by-default-v8.cpu_profiler"
3041
- ],
3042
- uuid,
3043
- args: {
3044
- data: {
3045
- cpuProfile: cpu_profile,
3046
- timeDeltas: cpu_profile.timeDeltas
3047
- }
3048
- }
3049
- });
3050
- }
3051
- };
3052
- await new Promise((resolve, reject)=>{
3006
+ this.layer && "off" !== this.state && (await new Promise((resolve, reject)=>{
3053
3007
  this.session.post("Profiler.stop", (err, params)=>{
3054
3008
  if (err) reject(err);
3055
3009
  else try {
3056
- profileHandler(err, params), resolve();
3010
+ let cpu_profile;
3011
+ var err1 = err, param = params;
3012
+ if (err1 ? console.error("Error stopping profiler:", err1) : cpu_profile = param.profile, cpu_profile) {
3013
+ let uuid = this.uuid();
3014
+ this.pushEvent({
3015
+ name: "Profile",
3016
+ ph: "P",
3017
+ trackName: "JavaScript CPU Profiler",
3018
+ processName: "JavaScript CPU",
3019
+ uuid,
3020
+ ...this.getCommonEv(),
3021
+ categories: [
3022
+ "disabled-by-default-v8.cpu_profiler"
3023
+ ],
3024
+ args: {
3025
+ data: {
3026
+ startTime: 0
3027
+ }
3028
+ }
3029
+ }), this.pushEvent({
3030
+ name: "ProfileChunk",
3031
+ ph: "P",
3032
+ trackName: "JavaScript CPU Profiler",
3033
+ processName: "JavaScript CPU",
3034
+ ...this.getCommonEv(),
3035
+ categories: [
3036
+ "disabled-by-default-v8.cpu_profiler"
3037
+ ],
3038
+ uuid,
3039
+ args: {
3040
+ data: {
3041
+ cpuProfile: cpu_profile,
3042
+ timeDeltas: cpu_profile.timeDeltas
3043
+ }
3044
+ }
3045
+ });
3046
+ }
3047
+ resolve();
3057
3048
  } catch (err) {
3058
3049
  reject(err);
3059
3050
  }
3060
3051
  });
3061
- }), this.state = "off";
3052
+ }), this.state = "off");
3062
3053
  }
3063
3054
  static getTs() {
3064
3055
  return process.hrtime.bigint() - this.startTime;
@@ -3172,7 +3163,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3172
3163
  error: serializeError(e)
3173
3164
  });
3174
3165
  }
3175
- Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, Number.POSITIVE_INFINITY);
3166
+ Atomics.add(sharedBufferView, 0, 1), Atomics.notify(sharedBufferView, 0, 1 / 0);
3176
3167
  }), mainSyncPort.on("messageerror", handleError);
3177
3168
  var obj = task, loaderName1 = loaderName;
3178
3169
  let errors = [];
@@ -3344,10 +3335,26 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3344
3335
  return loader.loaderItem;
3345
3336
  }
3346
3337
  }
3338
+ class JsSourceMap {
3339
+ static __from_binding(map) {
3340
+ return isNil(map) ? void 0 : ((input)=>{
3341
+ let s;
3342
+ if (Buffer.isBuffer(input)) s = input.toString("utf8");
3343
+ else if (input && "object" == typeof input) return input;
3344
+ else if ("string" == typeof input) s = input;
3345
+ else throw Error("Buffer or string or object expected");
3346
+ return JSON.parse(s);
3347
+ })(map);
3348
+ }
3349
+ static __to_binding(map) {
3350
+ return serializeObject(map);
3351
+ }
3352
+ }
3347
3353
  function getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
3348
3354
  return loaderContext.loaders?.length && index < loaderContext.loaders.length && index >= 0 && loaderContext.loaders[index] ? loaderContext.loaders[index] : null;
3349
3355
  }
3350
3356
  async function runLoaders(compiler, context) {
3357
+ var buildInfo;
3351
3358
  let loaderState = context.loaderState, pitch = loaderState === binding_.JsLoaderState.Pitching, { resource } = context, uuid = JavaScriptTracer.uuid();
3352
3359
  JavaScriptTracer.startAsync({
3353
3360
  name: "run_js_loaders",
@@ -3546,63 +3553,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3546
3553
  enumerable: !0,
3547
3554
  get: ()=>context.__internal__parseMeta
3548
3555
  });
3549
- let getWorkerLoaderContext = ()=>{
3550
- let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
3551
- hot: loaderContext.hot,
3552
- context: loaderContext.context,
3553
- resourcePath: loaderContext.resourcePath,
3554
- resourceQuery: loaderContext.resourceQuery,
3555
- resourceFragment: loaderContext.resourceFragment,
3556
- resource: loaderContext.resource,
3557
- mode: loaderContext.mode,
3558
- sourceMap: loaderContext.sourceMap,
3559
- rootContext: loaderContext.context,
3560
- loaderIndex: loaderContext.loaderIndex,
3561
- loaders: loaderContext.loaders.map((item)=>{
3562
- let options = item.options;
3563
- return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
3564
- ...item,
3565
- options,
3566
- pitch: void 0,
3567
- normal: void 0,
3568
- normalExecuted: item.normalExecuted,
3569
- pitchExecuted: item.pitchExecuted
3570
- };
3571
- }),
3572
- __internal__workerInfo: {
3573
- hashFunction: compiler._lastCompilation.outputOptions.hashFunction
3574
- },
3575
- _compiler: {
3576
- options: {
3577
- experiments: {
3578
- css: compiler.options.experiments.css
3579
- }
3580
- }
3581
- },
3582
- _compilation: {
3583
- options: {
3584
- output: {
3585
- environment: compiler._lastCompilation.outputOptions.environment
3586
- }
3587
- },
3588
- outputOptions: {
3589
- hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
3590
- hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
3591
- hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
3592
- hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
3593
- }
3594
- },
3595
- _module: {
3596
- type: loaderContext._module.type,
3597
- identifier: loaderContext._module.identifier(),
3598
- matchResource: normalModule?.matchResource,
3599
- request: normalModule?.request,
3600
- userRequest: normalModule?.userRequest,
3601
- rawRequest: normalModule?.rawRequest
3602
- }
3603
- };
3604
- return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
3605
- }, enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
3556
+ let enableParallelism = (currentLoaderObject)=>compiler.options.experiments.parallelLoader && currentLoaderObject?.parallel, isomorphoicRun = async (fn, args)=>{
3606
3557
  let result, currentLoaderObject = getCurrentLoader(loaderContext), parallelism = enableParallelism(currentLoaderObject), pitch = loaderState === binding_.JsLoaderState.Pitching, loaderName = function(loaderPath, cwd = "") {
3607
3558
  let res = loaderPath.replace(cwd, "");
3608
3559
  if (!external_node_path_default().isAbsolute(res)) return res;
@@ -3624,7 +3575,63 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3624
3575
  resource: resource
3625
3576
  }
3626
3577
  }), parallelism) result = await service_run(loaderName, {
3627
- loaderContext: getWorkerLoaderContext(),
3578
+ loaderContext: (()=>{
3579
+ let normalModule = loaderContext._module instanceof binding_.NormalModule ? loaderContext._module : void 0, workerLoaderContext = {
3580
+ hot: loaderContext.hot,
3581
+ context: loaderContext.context,
3582
+ resourcePath: loaderContext.resourcePath,
3583
+ resourceQuery: loaderContext.resourceQuery,
3584
+ resourceFragment: loaderContext.resourceFragment,
3585
+ resource: loaderContext.resource,
3586
+ mode: loaderContext.mode,
3587
+ sourceMap: loaderContext.sourceMap,
3588
+ rootContext: loaderContext.context,
3589
+ loaderIndex: loaderContext.loaderIndex,
3590
+ loaders: loaderContext.loaders.map((item)=>{
3591
+ let options = item.options;
3592
+ return (!item.parallel || item.request.startsWith(BUILTIN_LOADER_PREFIX)) && (options = void 0), {
3593
+ ...item,
3594
+ options,
3595
+ pitch: void 0,
3596
+ normal: void 0,
3597
+ normalExecuted: item.normalExecuted,
3598
+ pitchExecuted: item.pitchExecuted
3599
+ };
3600
+ }),
3601
+ __internal__workerInfo: {
3602
+ hashFunction: compiler._lastCompilation.outputOptions.hashFunction
3603
+ },
3604
+ _compiler: {
3605
+ options: {
3606
+ experiments: {
3607
+ css: compiler.options.experiments.css
3608
+ }
3609
+ }
3610
+ },
3611
+ _compilation: {
3612
+ options: {
3613
+ output: {
3614
+ environment: compiler._lastCompilation.outputOptions.environment
3615
+ }
3616
+ },
3617
+ outputOptions: {
3618
+ hashSalt: compiler._lastCompilation.outputOptions.hashSalt,
3619
+ hashFunction: compiler._lastCompilation.outputOptions.hashFunction,
3620
+ hashDigest: compiler._lastCompilation.outputOptions.hashDigest,
3621
+ hashDigestLength: compiler._lastCompilation.outputOptions.hashDigestLength
3622
+ }
3623
+ },
3624
+ _module: {
3625
+ type: loaderContext._module.type,
3626
+ identifier: loaderContext._module.identifier(),
3627
+ matchResource: normalModule?.matchResource,
3628
+ request: normalModule?.request,
3629
+ userRequest: normalModule?.userRequest,
3630
+ rawRequest: normalModule?.rawRequest
3631
+ }
3632
+ };
3633
+ return Object.assign(workerLoaderContext, compiler.options.loader), workerLoaderContext;
3634
+ })(),
3628
3635
  loaderState,
3629
3636
  args
3630
3637
  }, {
@@ -3772,14 +3779,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3772
3779
  ]);
3773
3780
  if (args.some((value)=>void 0 !== value)) {
3774
3781
  let [content, sourceMap, additionalData] = args;
3775
- context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = sourceMap || void 0, context.additionalData = additionalData || void 0;
3782
+ context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = serializeObject(sourceMap), context.additionalData = additionalData || void 0;
3776
3783
  break;
3777
3784
  }
3778
3785
  }
3779
3786
  break;
3780
3787
  case binding_.JsLoaderState.Normal:
3781
3788
  {
3782
- let content = context.content, sourceMap = context.sourceMap, additionalData = context.additionalData;
3789
+ let content = context.content, sourceMap = JsSourceMap.__from_binding(context.sourceMap), additionalData = context.additionalData;
3783
3790
  for(; loaderContext.loaderIndex >= 0;){
3784
3791
  let currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex], parallelism = enableParallelism(currentLoaderObject);
3785
3792
  if (currentLoaderObject.shouldYield()) break;
@@ -3795,7 +3802,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3795
3802
  additionalData
3796
3803
  ]));
3797
3804
  }
3798
- context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = sourceMap || void 0, context.additionalData = additionalData || void 0, context.__internal__utf8Hint = "string" == typeof content;
3805
+ context.content = isNil(content) ? null : toBuffer(content), context.sourceMap = JsSourceMap.__to_binding(sourceMap), context.additionalData = additionalData || void 0, context.__internal__utf8Hint = "string" == typeof content;
3799
3806
  break;
3800
3807
  }
3801
3808
  default:
@@ -3815,7 +3822,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3815
3822
  is_pitch: pitch,
3816
3823
  resource: resource
3817
3824
  }
3818
- }), compiler.options.experiments.cache && compiler.options?.cache && commitCustomFieldsToRust(context._module.buildInfo), context;
3825
+ }), compiler.options.experiments.cache && compiler.options?.cache && Object.keys(buildInfo = context._module.buildInfo).some((key)=>!knownBuildInfoFields.has(key)) && buildInfo[binding_.COMMIT_CUSTOM_FIELDS_SYMBOL](), context;
3819
3826
  }
3820
3827
  let loader_runner_PATH_QUERY_FRAGMENT_REGEXP = /^((?:\u200b.|[^?#\u200b])*)(\?(?:\u200b.|[^#\u200b])*)?(#.*)?$/;
3821
3828
  function parsePathQueryFragment(str) {
@@ -3839,8 +3846,41 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3839
3846
  ], path1 = path, options1 = options, uses1.length ? uses1.filter(Boolean).map((use, index)=>{
3840
3847
  let o, isBuiltin = !1;
3841
3848
  if (use.loader.startsWith(BUILTIN_LOADER_PREFIX)) {
3842
- var identifier, o1, options;
3843
- let temp = (identifier = use.loader, o1 = use.options, options = options1, identifier.startsWith(`${BUILTIN_LOADER_PREFIX}swc-loader`) ? getSwcLoaderOptions(o1, options) : identifier.startsWith(`${BUILTIN_LOADER_PREFIX}lightningcss-loader`) ? getLightningcssLoaderOptions(o1, options) : o1);
3849
+ let temp = function(identifier, o, options) {
3850
+ if (identifier.startsWith(`${BUILTIN_LOADER_PREFIX}swc-loader`)) {
3851
+ var o1, options1, options2 = o;
3852
+ if (options2 && "object" == typeof options2) {
3853
+ options2.jsc ??= {}, options2.jsc.experimental ??= {}, options2.jsc.experimental.disableAllLints ??= !0;
3854
+ let { rspackExperiments } = options2;
3855
+ rspackExperiments && ((rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
3856
+ if (pluginImport) return pluginImport.map((config)=>{
3857
+ let rawConfig = {
3858
+ ...config,
3859
+ style: {}
3860
+ };
3861
+ if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
3862
+ else if ("string" == typeof config.style) {
3863
+ let isTpl = config.style.includes("{{");
3864
+ rawConfig.style[isTpl ? "custom" : "css"] = config.style;
3865
+ } else {
3866
+ var val;
3867
+ val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
3868
+ }
3869
+ return config.styleLibraryDirectory && (rawConfig.style = {
3870
+ styleLibraryDirectory: config.styleLibraryDirectory
3871
+ }), rawConfig;
3872
+ });
3873
+ }(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
3874
+ typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
3875
+ exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
3876
+ }));
3877
+ }
3878
+ return options2;
3879
+ }
3880
+ return identifier.startsWith(`${BUILTIN_LOADER_PREFIX}lightningcss-loader`) ? ((o1 = o) && "object" == typeof o1 && ("string" == typeof o1.targets && (o1.targets = [
3881
+ o1.targets
3882
+ ]), o1.include && "object" == typeof o1.include && (o1.include = toFeatures(o1.include)), o1.exclude && "object" == typeof o1.exclude && (o1.exclude = toFeatures(o1.exclude))), o1) : o;
3883
+ }(use.loader, use.options, 0);
3844
3884
  o = isNil(temp) ? void 0 : "string" == typeof temp ? temp : JSON.stringify(temp, null, 2), isBuiltin = !0;
3845
3885
  }
3846
3886
  return {
@@ -3855,125 +3895,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3855
3895
  };
3856
3896
  }) : [];
3857
3897
  }
3858
- let getSwcLoaderOptions = (options, _)=>{
3859
- if (options && "object" == typeof options) {
3860
- options.jsc ??= {}, options.jsc.experimental ??= {}, options.jsc.experimental.disableAllLints ??= !0;
3861
- let { rspackExperiments } = options;
3862
- if (rspackExperiments) {
3863
- var options1;
3864
- (rspackExperiments.import || rspackExperiments.pluginImport) && (rspackExperiments.import = function(pluginImport) {
3865
- if (pluginImport) return pluginImport.map((config)=>{
3866
- let rawConfig = {
3867
- ...config,
3868
- style: {}
3869
- };
3870
- if ("boolean" == typeof config.style) rawConfig.style.bool = config.style;
3871
- else if ("string" == typeof config.style) {
3872
- let isTpl = config.style.includes("{{");
3873
- rawConfig.style[isTpl ? "custom" : "css"] = config.style;
3874
- } else {
3875
- var val;
3876
- val = config.style, "[object Object]" === Object.prototype.toString.call(val) && (rawConfig.style = config.style);
3877
- }
3878
- return config.styleLibraryDirectory && (rawConfig.style = {
3879
- styleLibraryDirectory: config.styleLibraryDirectory
3880
- }), rawConfig;
3881
- });
3882
- }(rspackExperiments.import || rspackExperiments.pluginImport)), rspackExperiments.collectTypeScriptInfo && (rspackExperiments.collectTypeScriptInfo = {
3883
- typeExports: (options1 = rspackExperiments.collectTypeScriptInfo).typeExports,
3884
- exportedEnum: !0 === options1.exportedEnum ? "all" : !1 === options1.exportedEnum ? "none" : "const-only"
3885
- });
3886
- }
3887
- }
3888
- return options;
3889
- }, getLightningcssLoaderOptions = (o, _)=>(o && "object" == typeof o && ("string" == typeof o.targets && (o.targets = [
3890
- o.targets
3891
- ]), o.include && "object" == typeof o.include && (o.include = toFeatures(o.include)), o.exclude && "object" == typeof o.exclude && (o.exclude = toFeatures(o.exclude))), o);
3892
3898
  function isUseSourceMap(devtool) {
3893
3899
  return !!devtool && devtool.includes("source-map") && (devtool.includes("module") || !devtool.includes("cheap"));
3894
3900
  }
3895
- let getRawOptions = (options, compiler)=>{
3896
- var output, module, options1, parser, generator, stats;
3897
- let mode = options.mode, experiments = options.experiments;
3898
- return {
3899
- name: options.name,
3900
- mode,
3901
- context: options.context,
3902
- output: {
3903
- ...output = options.output,
3904
- environment: function(environment = {}) {
3905
- return {
3906
- const: !!environment.const,
3907
- arrowFunction: !!environment.arrowFunction,
3908
- nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
3909
- asyncFunction: !!environment.asyncFunction,
3910
- bigIntLiteral: !!environment.bigIntLiteral,
3911
- destructuring: !!environment.destructuring,
3912
- document: !!environment.document,
3913
- dynamicImport: !!environment.dynamicImport,
3914
- forOf: !!environment.forOf,
3915
- globalThis: !!environment.globalThis,
3916
- module: !!environment.module,
3917
- optionalChaining: !!environment.optionalChaining,
3918
- templateLiteral: !!environment.templateLiteral
3919
- };
3920
- }(output.environment)
3921
- },
3922
- resolve: getRawResolve(options.resolve),
3923
- resolveLoader: getRawResolve(options.resolveLoader),
3924
- module: (module = options.module, options1 = {
3925
- compiler,
3926
- mode,
3927
- context: options.context,
3928
- experiments
3929
- }, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
3930
- rules: [
3931
- {
3932
- rules: module.defaultRules
3933
- },
3934
- {
3935
- rules: module.rules
3936
- }
3937
- ].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
3938
- parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
3939
- k,
3940
- getRawParserOptions(v, k)
3941
- ]).filter(([k, v])=>void 0 !== v)),
3942
- generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
3943
- k,
3944
- getRawGeneratorOptions(v, k)
3945
- ]).filter(([k, v])=>void 0 !== v)),
3946
- noParse: module.noParse
3947
- }),
3948
- optimization: options.optimization,
3949
- stats: {
3950
- colors: function(options) {
3951
- if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
3952
- if (!options) return {};
3953
- let obj = {
3954
- ...presetToOptions(options.preset),
3955
- ...options
3956
- };
3957
- return delete obj.preset, obj;
3958
- }(stats = options.stats).colors ?? !1
3959
- },
3960
- cache: {
3961
- type: options.cache ? "memory" : "disable"
3962
- },
3963
- experiments,
3964
- node: function(node) {
3965
- if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
3966
- dirname: String(node.__dirname),
3967
- filename: String(node.__filename),
3968
- global: String(node.global)
3969
- };
3970
- }(options.node),
3971
- profile: options.profile,
3972
- amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
3973
- bail: options.bail,
3974
- __references: {}
3975
- };
3976
- };
3977
3901
  function getRawAlias(alias = {}) {
3978
3902
  return !("object" != typeof alias || null === alias || Array.isArray(alias)) && Object.entries(alias).map(([key, value])=>({
3979
3903
  path: key,
@@ -4199,7 +4123,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4199
4123
  };
4200
4124
  }
4201
4125
  function getRawGeneratorOptions(generator, type) {
4202
- var options, options1, options2;
4126
+ var options, options1;
4203
4127
  if ("asset" === type) {
4204
4128
  return {
4205
4129
  type: "asset",
@@ -4234,14 +4158,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4234
4158
  type: "css/module",
4235
4159
  cssModule: getRawCssAutoOrModuleGeneratorOptions(generator)
4236
4160
  };
4237
- if ("json" === type) {
4238
- return {
4239
- type: "json",
4240
- json: {
4241
- JSONParse: (options2 = generator).JSONParse
4242
- }
4243
- };
4244
- }
4161
+ if ("json" === type) return {
4162
+ type: "json",
4163
+ json: {
4164
+ JSONParse: generator.JSONParse
4165
+ }
4166
+ };
4245
4167
  if (![
4246
4168
  "asset/source",
4247
4169
  "javascript",
@@ -4321,7 +4243,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4321
4243
  return Array.isArray(str) ? str.join("\n") : str;
4322
4244
  }
4323
4245
  static getModulesArrayBounds(modules) {
4324
- let maxId = Number.NEGATIVE_INFINITY, minId = Number.POSITIVE_INFINITY;
4246
+ let maxId = -1 / 0, minId = 1 / 0;
4325
4247
  for (let module of modules){
4326
4248
  let moduleId = module.id;
4327
4249
  if ("number" != typeof moduleId) return !1;
@@ -4553,10 +4475,10 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
4553
4475
  class DynamicEntryPlugin extends RspackBuiltinPlugin {
4554
4476
  context;
4555
4477
  entry;
4556
- name;
4557
- affectedHooks;
4478
+ name = binding_.BuiltinPluginName.DynamicEntryPlugin;
4479
+ affectedHooks = "make";
4558
4480
  constructor(context, entry){
4559
- super(), this.context = context, this.entry = entry, this.name = binding_.BuiltinPluginName.DynamicEntryPlugin, this.affectedHooks = "make";
4481
+ super(), this.context = context, this.entry = entry;
4560
4482
  }
4561
4483
  raw(compiler) {
4562
4484
  let raw = {
@@ -4604,9 +4526,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4604
4526
  };
4605
4527
  class EnableLibraryPlugin extends RspackBuiltinPlugin {
4606
4528
  type;
4607
- name;
4529
+ name = binding_.BuiltinPluginName.EnableLibraryPlugin;
4608
4530
  constructor(type){
4609
- super(), this.type = type, this.name = binding_.BuiltinPluginName.EnableLibraryPlugin;
4531
+ super(), this.type = type;
4610
4532
  }
4611
4533
  static setEnabled(compiler, type) {
4612
4534
  EnableLibraryPlugin_getEnabledTypes(compiler).add(type);
@@ -4623,9 +4545,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4623
4545
  class ExternalsPlugin extends RspackBuiltinPlugin {
4624
4546
  type;
4625
4547
  externals;
4626
- name;
4548
+ name = binding_.BuiltinPluginName.ExternalsPlugin;
4627
4549
  constructor(type, externals){
4628
- super(), this.type = type, this.externals = externals, this.name = binding_.BuiltinPluginName.ExternalsPlugin;
4550
+ super(), this.type = type, this.externals = externals;
4629
4551
  }
4630
4552
  raw(compiler) {
4631
4553
  let { type, externals } = this, raw = {
@@ -4694,10 +4616,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4694
4616
  let FileUriPlugin = base_create(binding_.BuiltinPluginName.FileUriPlugin, ()=>{}, "compilation"), FlagDependencyExportsPlugin = base_create(binding_.BuiltinPluginName.FlagDependencyExportsPlugin, ()=>{}, "compilation");
4695
4617
  class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
4696
4618
  global;
4697
- name;
4698
- affectedHooks;
4619
+ name = binding_.BuiltinPluginName.FlagDependencyUsagePlugin;
4620
+ affectedHooks = "compilation";
4699
4621
  constructor(global){
4700
- super(), this.global = global, this.name = binding_.BuiltinPluginName.FlagDependencyUsagePlugin, this.affectedHooks = "compilation";
4622
+ super(), this.global = global;
4701
4623
  }
4702
4624
  raw(compiler) {
4703
4625
  return createBuiltinPlugin(this.name, this.global);
@@ -4709,9 +4631,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4709
4631
  return void 0 === compiler.options.output.strictModuleErrorHandling && (compiler.options.output.strictModuleErrorHandling = !0), createBuiltinPlugin(this.name, void 0);
4710
4632
  }
4711
4633
  }
4712
- let hooks_compilationHooksMap = new WeakMap(), cleanPluginHooks = (compilation)=>{
4713
- hooks_compilationHooksMap.delete(compilation);
4714
- };
4634
+ let hooks_compilationHooksMap = new WeakMap();
4715
4635
  function $constructor(name, initializer, params) {
4716
4636
  function init(inst, def) {
4717
4637
  var _a;
@@ -4742,7 +4662,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4742
4662
  value: name
4743
4663
  }), _;
4744
4664
  }
4745
- Symbol("zod_brand");
4665
+ Object.freeze({
4666
+ status: "aborted"
4667
+ }), Symbol("zod_brand");
4746
4668
  class $ZodAsyncError extends Error {
4747
4669
  constructor(){
4748
4670
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
@@ -4752,9 +4674,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4752
4674
  function core_config(newConfig) {
4753
4675
  return newConfig && Object.assign(globalConfig, newConfig), globalConfig;
4754
4676
  }
4755
- function joinValues(array, separator = "|") {
4756
- return array.map((val)=>stringifyPrimitive(val)).join(separator);
4677
+ let cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, regexes_uuid = (version)=>version ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, base64url = /^[A-Za-z0-9_-]*$/, hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
4678
+ function timeSource(args) {
4679
+ let hhmm = "(?:[01]\\d|2[0-3]):[0-5]\\d";
4680
+ return "number" == typeof args.precision ? -1 === args.precision ? `${hhmm}` : 0 === args.precision ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
4757
4681
  }
4682
+ let integer = /^\d+$/, number = /^-?\d+(?:\.\d+)?/i, regexes_boolean = /true|false/i, _null = /null/i, _undefined = /undefined/i, lowercase = /^[^A-Z]*$/, uppercase = /^[^a-z]*$/;
4758
4683
  function jsonStringifyReplacer(_, value) {
4759
4684
  return "bigint" == typeof value ? value.toString() : value;
4760
4685
  }
@@ -4798,18 +4723,15 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4798
4723
  configurable: !0
4799
4724
  });
4800
4725
  }
4801
- function randomString(length = 10) {
4802
- let chars = "abcdefghijklmnopqrstuvwxyz", str = "";
4803
- for(let i = 0; i < length; i++)str += chars[Math.floor(Math.random() * chars.length)];
4804
- return str;
4805
- }
4806
4726
  function esc(str) {
4807
4727
  return JSON.stringify(str);
4808
4728
  }
4729
+ let captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args)=>{};
4809
4730
  function util_isObject(data) {
4810
4731
  return "object" == typeof data && null !== data && !Array.isArray(data);
4811
4732
  }
4812
4733
  let util_allowsEval = util_cached(()=>{
4734
+ if ("undefined" != typeof navigator && navigator?.userAgent?.includes("Cloudflare")) return !1;
4813
4735
  try {
4814
4736
  return Function(""), !0;
4815
4737
  } catch (_) {
@@ -4823,36 +4745,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4823
4745
  let prot = ctor.prototype;
4824
4746
  return !1 !== util_isObject(prot) && !1 !== Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf");
4825
4747
  }
4826
- let getParsedType = (data)=>{
4827
- let t = typeof data;
4828
- switch(t){
4829
- case "undefined":
4830
- return "undefined";
4831
- case "string":
4832
- return "string";
4833
- case "number":
4834
- return Number.isNaN(data) ? "nan" : "number";
4835
- case "boolean":
4836
- return "boolean";
4837
- case "function":
4838
- return "function";
4839
- case "bigint":
4840
- return "bigint";
4841
- case "symbol":
4842
- return "symbol";
4843
- case "object":
4844
- if (Array.isArray(data)) return "array";
4845
- if (null === data) return "null";
4846
- if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
4847
- if ("undefined" != typeof Map && data instanceof Map) return "map";
4848
- if ("undefined" != typeof Set && data instanceof Set) return "set";
4849
- if ("undefined" != typeof Date && data instanceof Date) return "date";
4850
- if ("undefined" != typeof File && data instanceof File) return "file";
4851
- return "object";
4852
- default:
4853
- throw Error(`Unknown data type: ${t}`);
4854
- }
4855
- }, propertyKeyTypes = new Set([
4748
+ let propertyKeyTypes = new Set([
4856
4749
  "string",
4857
4750
  "number",
4858
4751
  "symbol"
@@ -4878,9 +4771,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4878
4771
  error: ()=>_params.error
4879
4772
  } : _params;
4880
4773
  }
4881
- function stringifyPrimitive(value) {
4882
- return "bigint" == typeof value ? value.toString() + "n" : "string" == typeof value ? `"${value}"` : `${value}`;
4883
- }
4884
4774
  let NUMBER_FORMAT_RANGES = {
4885
4775
  safeint: [
4886
4776
  Number.MIN_SAFE_INTEGER,
@@ -4904,7 +4794,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4904
4794
  ]
4905
4795
  };
4906
4796
  function aborted(x, startIndex = 0) {
4907
- for(let i = startIndex; i < x.issues.length; i++)if (!0 !== x.issues[i].continue) return !0;
4797
+ for(let i = startIndex; i < x.issues.length; i++)if (x.issues[i]?.continue !== !0) return !0;
4908
4798
  return !1;
4909
4799
  }
4910
4800
  function prefixIssues(path, issues) {
@@ -4934,62 +4824,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4934
4824
  ...iss
4935
4825
  };
4936
4826
  }
4937
- let errors_initializer = (inst, def)=>{
4938
- inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
4939
- value: inst._zod,
4940
- enumerable: !1
4941
- }), Object.defineProperty(inst, "issues", {
4942
- value: def,
4943
- enumerable: !1
4944
- }), Object.defineProperty(inst, "message", {
4945
- get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
4946
- enumerable: !0
4947
- });
4948
- }, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
4949
- Parent: Error
4950
- }), _safeParse = (_Err)=>(schema, value, _ctx)=>{
4951
- let ctx = _ctx ? {
4952
- ..._ctx,
4953
- async: !1
4954
- } : {
4955
- async: !1
4956
- }, result = schema._zod.run({
4957
- value,
4958
- issues: []
4959
- }, ctx);
4960
- if (result instanceof Promise) throw new $ZodAsyncError();
4961
- return result.issues.length ? {
4962
- success: !1,
4963
- error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
4964
- } : {
4965
- success: !0,
4966
- data: result.value
4967
- };
4968
- }, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
4969
- let ctx = _ctx ? Object.assign(_ctx, {
4970
- async: !0
4971
- }) : {
4972
- async: !0
4973
- }, result = schema._zod.run({
4974
- value,
4975
- issues: []
4976
- }, ctx);
4977
- return result instanceof Promise && (result = await result), result.issues.length ? {
4978
- success: !1,
4979
- error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
4980
- } : {
4981
- success: !0,
4982
- data: result.value
4983
- };
4984
- }, safeParseAsync = _safeParseAsync($ZodRealError), cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, regexes_uuid = (version)=>version ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, base64url = /^[A-Za-z0-9_-]*$/, hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
4985
- function timeSource(args) {
4986
- let regex = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
4987
- return args.precision ? regex = `${regex}\\.\\d{${args.precision}}` : null == args.precision && (regex = `${regex}(\\.\\d+)?`), regex;
4988
- }
4989
- let string = (params)=>{
4990
- let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
4991
- return RegExp(`^${regex}$`);
4992
- }, integer = /^\d+$/, number = /^-?\d+(?:\.\d+)?/i, regexes_boolean = /true|false/i, _null = /null/i, _undefined = /undefined/i, lowercase = /^[^A-Z]*$/, uppercase = /^[^a-z]*$/, $ZodCheck = $constructor("$ZodCheck", (inst, def)=>{
4827
+ let $ZodCheck = $constructor("$ZodCheck", (inst, def)=>{
4993
4828
  var _a;
4994
4829
  inst._zod ?? (inst._zod = {}), inst._zod.def = def, (_a = inst._zod).onattach ?? (_a.onattach = []);
4995
4830
  }), numericOriginMap = {
@@ -5000,7 +4835,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5000
4835
  $ZodCheck.init(inst, def);
5001
4836
  let origin = numericOriginMap[typeof def.value];
5002
4837
  inst._zod.onattach.push((inst)=>{
5003
- let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
4838
+ let bag = inst._zod.bag, curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? 1 / 0;
5004
4839
  def.value < curr && (def.inclusive ? bag.maximum = def.value : bag.exclusiveMaximum = def.value);
5005
4840
  }), inst._zod.check = (payload)=>{
5006
4841
  (def.inclusive ? payload.value <= def.value : payload.value < def.value) || payload.issues.push({
@@ -5017,11 +4852,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5017
4852
  $ZodCheck.init(inst, def);
5018
4853
  let origin = numericOriginMap[typeof def.value];
5019
4854
  inst._zod.onattach.push((inst)=>{
5020
- let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
4855
+ let bag = inst._zod.bag, curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? -1 / 0;
5021
4856
  def.value > curr && (def.inclusive ? bag.minimum = def.value : bag.exclusiveMinimum = def.value);
5022
4857
  }), inst._zod.check = (payload)=>{
5023
4858
  (def.inclusive ? payload.value >= def.value : payload.value > def.value) || payload.issues.push({
5024
- origin: origin,
4859
+ origin,
5025
4860
  code: "too_small",
5026
4861
  minimum: def.value,
5027
4862
  input: payload.value,
@@ -5084,9 +4919,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5084
4919
  }
5085
4920
  input < minimum && payload.issues.push({
5086
4921
  origin: "number",
5087
- input: input,
4922
+ input,
5088
4923
  code: "too_small",
5089
- minimum: minimum,
4924
+ minimum,
5090
4925
  inclusive: !0,
5091
4926
  inst,
5092
4927
  continue: !def.abort
@@ -5099,12 +4934,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5099
4934
  });
5100
4935
  };
5101
4936
  }), $ZodCheckMaxLength = $constructor("$ZodCheckMaxLength", (inst, def)=>{
5102
- $ZodCheck.init(inst, def), inst._zod.when = (payload)=>{
5103
- var input;
4937
+ var _a;
4938
+ $ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
5104
4939
  let val = payload.value;
5105
4940
  return null != val && void 0 !== val.length;
5106
- }, inst._zod.onattach.push((inst)=>{
5107
- let curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
4941
+ }), inst._zod.onattach.push((inst)=>{
4942
+ let curr = inst._zod.bag.maximum ?? 1 / 0;
5108
4943
  def.maximum < curr && (inst._zod.bag.maximum = def.maximum);
5109
4944
  }), inst._zod.check = (payload)=>{
5110
4945
  let input = payload.value;
@@ -5121,12 +4956,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5121
4956
  });
5122
4957
  };
5123
4958
  }), $ZodCheckMinLength = $constructor("$ZodCheckMinLength", (inst, def)=>{
5124
- $ZodCheck.init(inst, def), inst._zod.when = (payload)=>{
5125
- var input;
4959
+ var _a;
4960
+ $ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
5126
4961
  let val = payload.value;
5127
4962
  return null != val && void 0 !== val.length;
5128
- }, inst._zod.onattach.push((inst)=>{
5129
- let curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
4963
+ }), inst._zod.onattach.push((inst)=>{
4964
+ let curr = inst._zod.bag.minimum ?? -1 / 0;
5130
4965
  def.minimum > curr && (inst._zod.bag.minimum = def.minimum);
5131
4966
  }), inst._zod.check = (payload)=>{
5132
4967
  let input = payload.value;
@@ -5143,11 +4978,11 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5143
4978
  });
5144
4979
  };
5145
4980
  }), $ZodCheckLengthEquals = $constructor("$ZodCheckLengthEquals", (inst, def)=>{
5146
- $ZodCheck.init(inst, def), inst._zod.when = (payload)=>{
5147
- var input;
4981
+ var _a;
4982
+ $ZodCheck.init(inst, def), (_a = inst._zod.def).when ?? (_a.when = (payload)=>{
5148
4983
  let val = payload.value;
5149
4984
  return null != val && void 0 !== val.length;
5150
- }, inst._zod.onattach.push((inst)=>{
4985
+ }), inst._zod.onattach.push((inst)=>{
5151
4986
  let bag = inst._zod.bag;
5152
4987
  bag.minimum = def.length, bag.maximum = def.length, bag.length = def.length;
5153
4988
  }), inst._zod.check = (payload)=>{
@@ -5163,18 +4998,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5163
4998
  code: "too_small",
5164
4999
  minimum: def.length
5165
5000
  },
5001
+ inclusive: !0,
5002
+ exact: !0,
5166
5003
  input: payload.value,
5167
5004
  inst,
5168
5005
  continue: !def.abort
5169
5006
  });
5170
5007
  };
5171
5008
  }), $ZodCheckStringFormat = $constructor("$ZodCheckStringFormat", (inst, def)=>{
5172
- var _a;
5009
+ var _a, _b;
5173
5010
  $ZodCheck.init(inst, def), inst._zod.onattach.push((inst)=>{
5174
5011
  let bag = inst._zod.bag;
5175
5012
  bag.format = def.format, def.pattern && (bag.patterns ?? (bag.patterns = new Set()), bag.patterns.add(def.pattern));
5176
- }), (_a = inst._zod).check ?? (_a.check = (payload)=>{
5177
- if (!def.pattern) throw Error("Not implemented.");
5013
+ }), def.pattern ? (_a = inst._zod).check ?? (_a.check = (payload)=>{
5178
5014
  def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
5179
5015
  origin: "string",
5180
5016
  code: "invalid_format",
@@ -5186,7 +5022,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5186
5022
  inst,
5187
5023
  continue: !def.abort
5188
5024
  });
5189
- });
5025
+ }) : (_b = inst._zod).check ?? (_b.check = ()=>{});
5190
5026
  }), $ZodCheckRegex = $constructor("$ZodCheckRegex", (inst, def)=>{
5191
5027
  $ZodCheckStringFormat.init(inst, def), inst._zod.check = (payload)=>{
5192
5028
  def.pattern.lastIndex = 0, def.pattern.test(payload.value) || payload.issues.push({
@@ -5287,41 +5123,91 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5287
5123
  ].join("\n"));
5288
5124
  }
5289
5125
  }
5290
- let versions_version = {
5291
- major: 4,
5292
- minor: 0,
5293
- patch: 0
5294
- }, $ZodType = $constructor("$ZodType", (inst, def)=>{
5295
- var _a;
5296
- inst ?? (inst = {}), defineLazy(inst._zod, "id", ()=>def.type + "_" + randomString(10)), inst._zod.def = def, inst._zod.bag = inst._zod.bag || {}, inst._zod.version = versions_version;
5297
- let checks = [
5298
- ...inst._zod.def.checks ?? []
5299
- ];
5300
- for (let ch of (inst._zod.traits.has("$ZodCheck") && checks.unshift(inst), checks))for (let fn of ch._zod.onattach)fn(inst);
5301
- if (0 === checks.length) (_a = inst._zod).deferred ?? (_a.deferred = []), inst._zod.deferred?.push(()=>{
5302
- inst._zod.run = inst._zod.parse;
5126
+ let errors_initializer = (inst, def)=>{
5127
+ inst.name = "$ZodError", Object.defineProperty(inst, "_zod", {
5128
+ value: inst._zod,
5129
+ enumerable: !1
5130
+ }), Object.defineProperty(inst, "issues", {
5131
+ value: def,
5132
+ enumerable: !1
5133
+ }), Object.defineProperty(inst, "message", {
5134
+ get: ()=>JSON.stringify(def, jsonStringifyReplacer, 2),
5135
+ enumerable: !0
5136
+ }), Object.defineProperty(inst, "toString", {
5137
+ value: ()=>inst.message,
5138
+ enumerable: !1
5303
5139
  });
5304
- else {
5305
- let runChecks = (payload, checks, ctx)=>{
5306
- let asyncResult, isAborted = aborted(payload);
5307
- for (let ch of checks){
5308
- if (ch._zod.when) {
5309
- if (!ch._zod.when(payload)) continue;
5310
- } else if (isAborted) continue;
5311
- let currLen = payload.issues.length, _ = ch._zod.check(payload);
5312
- if (_ instanceof Promise && ctx?.async === !1) throw new $ZodAsyncError();
5313
- if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async ()=>{
5314
- await _, payload.issues.length !== currLen && (isAborted || (isAborted = aborted(payload, currLen)));
5315
- });
5316
- else {
5317
- if (payload.issues.length === currLen) continue;
5318
- isAborted || (isAborted = aborted(payload, currLen));
5319
- }
5320
- }
5321
- return asyncResult ? asyncResult.then(()=>payload) : payload;
5322
- };
5323
- inst._zod.run = (payload, ctx)=>{
5324
- let result = inst._zod.parse(payload, ctx);
5140
+ }, $ZodError = $constructor("$ZodError", errors_initializer), $ZodRealError = $constructor("$ZodError", errors_initializer, {
5141
+ Parent: Error
5142
+ }), _safeParse = (_Err)=>(schema, value, _ctx)=>{
5143
+ let ctx = _ctx ? {
5144
+ ..._ctx,
5145
+ async: !1
5146
+ } : {
5147
+ async: !1
5148
+ }, result = schema._zod.run({
5149
+ value,
5150
+ issues: []
5151
+ }, ctx);
5152
+ if (result instanceof Promise) throw new $ZodAsyncError();
5153
+ return result.issues.length ? {
5154
+ success: !1,
5155
+ error: new (_Err ?? $ZodError)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
5156
+ } : {
5157
+ success: !0,
5158
+ data: result.value
5159
+ };
5160
+ }, safeParse = _safeParse($ZodRealError), _safeParseAsync = (_Err)=>async (schema, value, _ctx)=>{
5161
+ let ctx = _ctx ? Object.assign(_ctx, {
5162
+ async: !0
5163
+ }) : {
5164
+ async: !0
5165
+ }, result = schema._zod.run({
5166
+ value,
5167
+ issues: []
5168
+ }, ctx);
5169
+ return result instanceof Promise && (result = await result), result.issues.length ? {
5170
+ success: !1,
5171
+ error: new _Err(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())))
5172
+ } : {
5173
+ success: !0,
5174
+ data: result.value
5175
+ };
5176
+ }, safeParseAsync = _safeParseAsync($ZodRealError), versions_version = {
5177
+ major: 4,
5178
+ minor: 0,
5179
+ patch: 0
5180
+ }, $ZodType = $constructor("$ZodType", (inst, def)=>{
5181
+ var _a;
5182
+ inst ?? (inst = {}), inst._zod.def = def, inst._zod.bag = inst._zod.bag || {}, inst._zod.version = versions_version;
5183
+ let checks = [
5184
+ ...inst._zod.def.checks ?? []
5185
+ ];
5186
+ for (let ch of (inst._zod.traits.has("$ZodCheck") && checks.unshift(inst), checks))for (let fn of ch._zod.onattach)fn(inst);
5187
+ if (0 === checks.length) (_a = inst._zod).deferred ?? (_a.deferred = []), inst._zod.deferred?.push(()=>{
5188
+ inst._zod.run = inst._zod.parse;
5189
+ });
5190
+ else {
5191
+ let runChecks = (payload, checks, ctx)=>{
5192
+ let asyncResult, isAborted = aborted(payload);
5193
+ for (let ch of checks){
5194
+ if (ch._zod.def.when) {
5195
+ if (!ch._zod.def.when(payload)) continue;
5196
+ } else if (isAborted) continue;
5197
+ let currLen = payload.issues.length, _ = ch._zod.check(payload);
5198
+ if (_ instanceof Promise && ctx?.async === !1) throw new $ZodAsyncError();
5199
+ if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async ()=>{
5200
+ await _, payload.issues.length !== currLen && (isAborted || (isAborted = aborted(payload, currLen)));
5201
+ });
5202
+ else {
5203
+ if (payload.issues.length === currLen) continue;
5204
+ isAborted || (isAborted = aborted(payload, currLen));
5205
+ }
5206
+ }
5207
+ return asyncResult ? asyncResult.then(()=>payload) : payload;
5208
+ };
5209
+ inst._zod.run = (payload, ctx)=>{
5210
+ let result = inst._zod.parse(payload, ctx);
5325
5211
  if (result instanceof Promise) {
5326
5212
  if (!1 === ctx.async) throw new $ZodAsyncError();
5327
5213
  return result.then((result)=>runChecks(result, checks, ctx));
@@ -5352,7 +5238,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5352
5238
  }), $ZodString = $constructor("$ZodString", (inst, def)=>{
5353
5239
  $ZodType.init(inst, def), inst._zod.pattern = [
5354
5240
  ...inst?._zod.bag?.patterns ?? []
5355
- ].pop() ?? string(inst._zod.bag), inst._zod.parse = (payload, _)=>{
5241
+ ].pop() ?? ((params)=>{
5242
+ let regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : "[\\s\\S]*";
5243
+ return RegExp(`^${regex}$`);
5244
+ })(inst._zod.bag), inst._zod.parse = (payload, _)=>{
5356
5245
  if (def.coerce) try {
5357
5246
  payload.value = String(payload.value);
5358
5247
  } catch (_) {}
@@ -5388,7 +5277,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5388
5277
  }), $ZodURL = $constructor("$ZodURL", (inst, def)=>{
5389
5278
  $ZodStringFormat.init(inst, def), inst._zod.check = (payload)=>{
5390
5279
  try {
5391
- let url = new URL(payload.value);
5280
+ let orig = payload.value, url = new URL(orig), href = url.href;
5392
5281
  def.hostname && (def.hostname.lastIndex = 0, def.hostname.test(url.hostname) || payload.issues.push({
5393
5282
  code: "invalid_format",
5394
5283
  format: "url",
@@ -5405,7 +5294,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5405
5294
  input: payload.value,
5406
5295
  inst,
5407
5296
  continue: !def.abort
5408
- }));
5297
+ })), !orig.endsWith("/") && href.endsWith("/") ? payload.value = href.slice(0, -1) : payload.value = href;
5409
5298
  return;
5410
5299
  } catch (_) {
5411
5300
  payload.issues.push({
@@ -5433,8 +5322,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5433
5322
  def.pattern ?? (def.pattern = ksuid), $ZodStringFormat.init(inst, def);
5434
5323
  }), $ZodISODateTime = $constructor("$ZodISODateTime", (inst, def)=>{
5435
5324
  def.pattern ?? (def.pattern = function(args) {
5436
- let regex = `${dateSource}T${timeSource(args)}`, opts = [];
5437
- return opts.push(args.local ? "Z?" : "Z"), args.offset && opts.push("([+-]\\d{2}:?\\d{2})"), regex = `${regex}(${opts.join("|")})`, RegExp(`^${regex}$`);
5325
+ let time = timeSource({
5326
+ precision: args.precision
5327
+ }), opts = [
5328
+ "Z"
5329
+ ];
5330
+ args.local && opts.push(""), args.offset && opts.push("([+-]\\d{2}:\\d{2})");
5331
+ let timeRegex = `${time}(?:${opts.join("|")})`;
5332
+ return RegExp(`^${dateSource}T(?:${timeRegex})$`);
5438
5333
  }(def)), $ZodStringFormat.init(inst, def);
5439
5334
  }), $ZodISODate = $constructor("$ZodISODate", (inst, def)=>{
5440
5335
  def.pattern ?? (def.pattern = regexes_date), $ZodStringFormat.init(inst, def);
@@ -5529,7 +5424,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5529
5424
  try {
5530
5425
  let tokensParts = token.split(".");
5531
5426
  if (3 !== tokensParts.length) return !1;
5532
- let [header] = tokensParts, parsedHeader = JSON.parse(atob(header));
5427
+ let [header] = tokensParts;
5428
+ if (!header) return !1;
5429
+ let parsedHeader = JSON.parse(atob(header));
5533
5430
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT" || !parsedHeader.alg || algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return !1;
5534
5431
  return !0;
5535
5432
  } catch {
@@ -5579,8 +5476,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5579
5476
  }), $ZodUndefined = $constructor("$ZodUndefined", (inst, def)=>{
5580
5477
  $ZodType.init(inst, def), inst._zod.pattern = _undefined, inst._zod.values = new Set([
5581
5478
  void 0
5582
- ]), inst._zod.parse = (payload, _ctx)=>{
5583
- let { value: input } = payload;
5479
+ ]), inst._zod.optin = "optional", inst._zod.optout = "optional", inst._zod.parse = (payload, _ctx)=>{
5480
+ let input = payload.value;
5584
5481
  return void 0 === input || payload.issues.push({
5585
5482
  expected: "undefined",
5586
5483
  code: "invalid_type",
@@ -5592,7 +5489,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5592
5489
  $ZodType.init(inst, def), inst._zod.pattern = _null, inst._zod.values = new Set([
5593
5490
  null
5594
5491
  ]), inst._zod.parse = (payload, _ctx)=>{
5595
- let { value: input } = payload;
5492
+ let input = payload.value;
5596
5493
  return null === input || payload.issues.push({
5597
5494
  expected: "null",
5598
5495
  code: "invalid_type",
@@ -5666,23 +5563,34 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5666
5563
  }
5667
5564
  return propValues;
5668
5565
  });
5669
- let generateFastpass = (shape)=>{
5670
- let doc = new Doc([
5671
- "shape",
5672
- "payload",
5673
- "ctx"
5674
- ]), { keys, optionalKeys } = _normalized.value, parseStr = (key)=>{
5675
- let k = esc(key);
5676
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
5677
- };
5678
- doc.write("const input = payload.value;");
5679
- let ids = Object.create(null);
5680
- for (let key of keys)ids[key] = randomString(15);
5681
- for (let key of (doc.write("const newResult = {}"), keys))if (optionalKeys.has(key)) {
5682
- let id = ids[key];
5683
- doc.write(`const ${id} = ${parseStr(key)};`);
5684
- let k = esc(key);
5685
- doc.write(`
5566
+ let jit = !globalConfig.jitless, fastEnabled = jit && util_allowsEval.value, catchall = def.catchall;
5567
+ inst._zod.parse = (payload, ctx)=>{
5568
+ value ?? (value = _normalized.value);
5569
+ let input = payload.value;
5570
+ if (!util_isObject(input)) return payload.issues.push({
5571
+ expected: "object",
5572
+ code: "invalid_type",
5573
+ input,
5574
+ inst
5575
+ }), payload;
5576
+ let proms = [];
5577
+ if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = ((shape)=>{
5578
+ let doc = new Doc([
5579
+ "shape",
5580
+ "payload",
5581
+ "ctx"
5582
+ ]), normalized = _normalized.value, parseStr = (key)=>{
5583
+ let k = esc(key);
5584
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
5585
+ };
5586
+ doc.write("const input = payload.value;");
5587
+ let ids = Object.create(null), counter = 0;
5588
+ for (let key of normalized.keys)ids[key] = `key_${counter++}`;
5589
+ for (let key of (doc.write("const newResult = {}"), normalized.keys))if (normalized.optionalKeys.has(key)) {
5590
+ let id = ids[key];
5591
+ doc.write(`const ${id} = ${parseStr(key)};`);
5592
+ let k = esc(key);
5593
+ doc.write(`
5686
5594
  if (${id}.issues.length) {
5687
5595
  if (input[${k}] === undefined) {
5688
5596
  if (${k} in input) {
@@ -5702,29 +5610,18 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5702
5610
  newResult[${k}] = ${id}.value;
5703
5611
  }
5704
5612
  `);
5705
- } else {
5706
- let id = ids[key];
5707
- doc.write(`const ${id} = ${parseStr(key)};`), doc.write(`
5613
+ } else {
5614
+ let id = ids[key];
5615
+ doc.write(`const ${id} = ${parseStr(key)};`), doc.write(`
5708
5616
  if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
5709
5617
  ...iss,
5710
5618
  path: iss.path ? [${esc(key)}, ...iss.path] : [${esc(key)}]
5711
5619
  })));`), doc.write(`newResult[${esc(key)}] = ${id}.value`);
5712
- }
5713
- doc.write("payload.value = newResult;"), doc.write("return payload;");
5714
- let fn = doc.compile();
5715
- return (payload, ctx)=>fn(shape, payload, ctx);
5716
- }, jit = !globalConfig.jitless, fastEnabled = jit && util_allowsEval.value, { catchall } = def;
5717
- inst._zod.parse = (payload, ctx)=>{
5718
- value ?? (value = _normalized.value);
5719
- let input = payload.value;
5720
- if (!util_isObject(input)) return payload.issues.push({
5721
- expected: "object",
5722
- code: "invalid_type",
5723
- input,
5724
- inst
5725
- }), payload;
5726
- let proms = [];
5727
- if (jit && fastEnabled && ctx?.async === !1 && !0 !== ctx.jitless) fastpass || (fastpass = generateFastpass(def.shape)), payload = fastpass(payload, ctx);
5620
+ }
5621
+ doc.write("payload.value = newResult;"), doc.write("return payload;");
5622
+ let fn = doc.compile();
5623
+ return (payload, ctx)=>fn(shape, payload, ctx);
5624
+ })(def.shape)), payload = fastpass(payload, ctx);
5728
5625
  else {
5729
5626
  payload.value = {};
5730
5627
  let shape = value.shape;
@@ -5768,7 +5665,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5768
5665
  }), final;
5769
5666
  }
5770
5667
  let $ZodUnion = $constructor("$ZodUnion", (inst, def)=>{
5771
- $ZodType.init(inst, def), defineLazy(inst._zod, "values", ()=>{
5668
+ $ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.options.some((o)=>"optional" === o._zod.optin) ? "optional" : void 0), defineLazy(inst._zod, "optout", ()=>def.options.some((o)=>"optional" === o._zod.optout) ? "optional" : void 0), defineLazy(inst._zod, "values", ()=>{
5772
5669
  if (def.options.every((o)=>o._zod.values)) return new Set(def.options.flatMap((option)=>Array.from(option._zod.values)));
5773
5670
  }), defineLazy(inst._zod, "pattern", ()=>{
5774
5671
  if (def.options.every((o)=>o._zod.pattern)) {
@@ -5792,7 +5689,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5792
5689
  };
5793
5690
  }), $ZodIntersection = $constructor("$ZodIntersection", (inst, def)=>{
5794
5691
  $ZodType.init(inst, def), inst._zod.parse = (payload, ctx)=>{
5795
- let { value: input } = payload, left = def.left._zod.run({
5692
+ let input = payload.value, left = def.left._zod.run({
5796
5693
  value: input,
5797
5694
  issues: []
5798
5695
  }, ctx), right = def.right._zod.run({
@@ -5863,7 +5760,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5863
5760
  if (!merged.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
5864
5761
  return result.value = merged.data, result;
5865
5762
  }
5866
- let schemas_$ZodTuple = $constructor("$ZodTuple", (inst, def)=>{
5763
+ let $ZodTuple = $constructor("$ZodTuple", (inst, def)=>{
5867
5764
  $ZodType.init(inst, def);
5868
5765
  let items = def.items, optStart = items.length - [
5869
5766
  ...items
@@ -6013,7 +5910,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6013
5910
  ]) : void 0), defineLazy(inst._zod, "pattern", ()=>{
6014
5911
  let pattern = def.innerType._zod.pattern;
6015
5912
  return pattern ? RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
6016
- }), inst._zod.parse = (payload, ctx)=>void 0 === payload.value ? payload : def.innerType._zod.run(payload, ctx);
5913
+ }), inst._zod.parse = (payload, ctx)=>"optional" === def.innerType._zod.optin ? def.innerType._zod.run(payload, ctx) : void 0 === payload.value ? payload : def.innerType._zod.run(payload, ctx);
6017
5914
  }), $ZodNullable = $constructor("$ZodNullable", (inst, def)=>{
6018
5915
  $ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "pattern", ()=>{
6019
5916
  let pattern = def.innerType._zod.pattern;
@@ -6054,7 +5951,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6054
5951
  }), payload;
6055
5952
  }
6056
5953
  let $ZodCatch = $constructor("$ZodCatch", (inst, def)=>{
6057
- $ZodType.init(inst, def), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), inst._zod.parse = (payload, ctx)=>{
5954
+ $ZodType.init(inst, def), inst._zod.optin = "optional", defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), inst._zod.parse = (payload, ctx)=>{
6058
5955
  let result = def.innerType._zod.run(payload, ctx);
6059
5956
  return result instanceof Promise ? result.then((result)=>(payload.value = result.value, result.issues.length && (payload.value = def.catchValue({
6060
5957
  ...payload,
@@ -6083,7 +5980,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6083
5980
  }, ctx);
6084
5981
  }
6085
5982
  let $ZodReadonly = $constructor("$ZodReadonly", (inst, def)=>{
6086
- $ZodType.init(inst, def), defineLazy(inst._zod, "propValues", ()=>def.innerType._zod.propValues), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), inst._zod.parse = (payload, ctx)=>{
5983
+ $ZodType.init(inst, def), defineLazy(inst._zod, "propValues", ()=>def.innerType._zod.propValues), defineLazy(inst._zod, "values", ()=>def.innerType._zod.values), defineLazy(inst._zod, "optin", ()=>def.innerType._zod.optin), defineLazy(inst._zod, "optout", ()=>def.innerType._zod.optout), inst._zod.parse = (payload, ctx)=>{
6087
5984
  let result = def.innerType._zod.run(payload, ctx);
6088
5985
  return result instanceof Promise ? result.then(handleReadonlyResult) : handleReadonlyResult(result);
6089
5986
  };
@@ -6114,108 +6011,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6114
6011
  inst._zod.def.params && (_iss.params = inst._zod.def.params), payload.issues.push(util_issue(_iss));
6115
6012
  }
6116
6013
  }
6117
- let en_parsedType = (data)=>{
6118
- let t = typeof data;
6119
- switch(t){
6120
- case "number":
6121
- return Number.isNaN(data) ? "NaN" : "number";
6122
- case "object":
6123
- if (Array.isArray(data)) return "array";
6124
- if (null === data) return "null";
6125
- if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) return data.constructor.name;
6126
- }
6127
- return t;
6128
- }, en_error = ()=>{
6129
- let Sizable = {
6130
- string: {
6131
- unit: "characters",
6132
- verb: "to have"
6133
- },
6134
- file: {
6135
- unit: "bytes",
6136
- verb: "to have"
6137
- },
6138
- array: {
6139
- unit: "items",
6140
- verb: "to have"
6141
- },
6142
- set: {
6143
- unit: "items",
6144
- verb: "to have"
6145
- }
6146
- }, Nouns = {
6147
- regex: "input",
6148
- email: "email address",
6149
- url: "URL",
6150
- emoji: "emoji",
6151
- uuid: "UUID",
6152
- uuidv4: "UUIDv4",
6153
- uuidv6: "UUIDv6",
6154
- nanoid: "nanoid",
6155
- guid: "GUID",
6156
- cuid: "cuid",
6157
- cuid2: "cuid2",
6158
- ulid: "ULID",
6159
- xid: "XID",
6160
- ksuid: "KSUID",
6161
- datetime: "ISO datetime",
6162
- date: "ISO date",
6163
- time: "ISO time",
6164
- duration: "ISO duration",
6165
- ipv4: "IPv4 address",
6166
- ipv6: "IPv6 address",
6167
- cidrv4: "IPv4 range",
6168
- cidrv6: "IPv6 range",
6169
- base64: "base64-encoded string",
6170
- base64url: "base64url-encoded string",
6171
- json_string: "JSON string",
6172
- e164: "E.164 number",
6173
- jwt: "JWT",
6174
- template_literal: "input"
6175
- };
6176
- return (issue)=>{
6177
- switch(issue.code){
6178
- case "invalid_type":
6179
- return `Invalid input: expected ${issue.expected}, received ${en_parsedType(issue.input)}`;
6180
- case "invalid_value":
6181
- if (1 === issue.values.length) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
6182
- return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
6183
- case "too_big":
6184
- {
6185
- let adj = issue.inclusive ? "<=" : "<", sizing = Sizable[issue.origin] ?? null;
6186
- if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
6187
- return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
6188
- }
6189
- case "too_small":
6190
- {
6191
- let adj = issue.inclusive ? ">=" : ">", sizing = Sizable[issue.origin] ?? null;
6192
- if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
6193
- return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
6194
- }
6195
- case "invalid_format":
6196
- if ("starts_with" === issue.format) return `Invalid string: must start with "${issue.prefix}"`;
6197
- if ("ends_with" === issue.format) return `Invalid string: must end with "${issue.suffix}"`;
6198
- if ("includes" === issue.format) return `Invalid string: must include "${issue.includes}"`;
6199
- if ("regex" === issue.format) return `Invalid string: must match pattern ${issue.pattern}`;
6200
- return `Invalid ${Nouns[issue.format] ?? issue.format}`;
6201
- case "not_multiple_of":
6202
- return `Invalid number: must be a multiple of ${issue.divisor}`;
6203
- case "unrecognized_keys":
6204
- return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
6205
- case "invalid_key":
6206
- return `Invalid key in ${issue.origin}`;
6207
- case "invalid_union":
6208
- default:
6209
- return "Invalid input";
6210
- case "invalid_element":
6211
- return `Invalid value in ${issue.origin}`;
6212
- }
6213
- };
6214
- };
6215
6014
  Symbol("ZodOutput"), Symbol("ZodInput");
6216
- class registries_$ZodRegistry {
6015
+ class $ZodRegistry {
6217
6016
  constructor(){
6218
- this._map = new WeakMap(), this._idmap = new Map();
6017
+ this._map = new Map(), this._idmap = new Map();
6219
6018
  }
6220
6019
  add(schema, ..._meta) {
6221
6020
  let meta = _meta[0];
@@ -6225,8 +6024,12 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6225
6024
  }
6226
6025
  return this;
6227
6026
  }
6027
+ clear() {
6028
+ return this._map = new Map(), this._idmap = new Map(), this;
6029
+ }
6228
6030
  remove(schema) {
6229
- return this._map.delete(schema), this;
6031
+ let meta = this._map.get(schema);
6032
+ return meta && "object" == typeof meta && "id" in meta && this._idmap.delete(meta.id), this._map.delete(schema), this;
6230
6033
  }
6231
6034
  get(schema) {
6232
6035
  let p = schema._zod.parent;
@@ -6245,7 +6048,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6245
6048
  return this._map.has(schema);
6246
6049
  }
6247
6050
  }
6248
- let registries_globalRegistry = new registries_$ZodRegistry();
6051
+ let globalRegistry = new $ZodRegistry();
6249
6052
  function _guid(Class, params) {
6250
6053
  return new Class({
6251
6054
  type: "string",
@@ -6387,7 +6190,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6387
6190
  $constructor("ZodError", classic_errors_initializer);
6388
6191
  let ZodRealError = $constructor("ZodError", classic_errors_initializer, {
6389
6192
  Parent: Error
6390
- }), classic_parse_parse = (_Err = ZodRealError, (schema, value, _ctx, _params)=>{
6193
+ }), parse_parse = (_Err = ZodRealError, (schema, value, _ctx, _params)=>{
6391
6194
  let ctx = _ctx ? Object.assign(_ctx, {
6392
6195
  async: !1
6393
6196
  }) : {
@@ -6399,10 +6202,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6399
6202
  if (result instanceof Promise) throw new $ZodAsyncError();
6400
6203
  if (result.issues.length) {
6401
6204
  let e = new (_params?.Err ?? _Err)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
6402
- throw Error.captureStackTrace(e, _params?.callee), e;
6205
+ throw captureStackTrace(e, _params?.callee), e;
6403
6206
  }
6404
6207
  return result.value;
6405
- }), classic_parse_parseAsync = (_Err1 = ZodRealError, async (schema, value, _ctx, params)=>{
6208
+ }), parse_parseAsync = (_Err1 = ZodRealError, async (schema, value, _ctx, params)=>{
6406
6209
  let ctx = _ctx ? Object.assign(_ctx, {
6407
6210
  async: !0
6408
6211
  }) : {
@@ -6413,7 +6216,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6413
6216
  }, ctx);
6414
6217
  if (result instanceof Promise && (result = await result), result.issues.length) {
6415
6218
  let e = new (params?.Err ?? _Err1)(result.issues.map((iss)=>finalizeIssue(iss, ctx, core_config())));
6416
- throw Error.captureStackTrace(e, params?.callee), e;
6219
+ throw captureStackTrace(e, params?.callee), e;
6417
6220
  }
6418
6221
  return result.value;
6419
6222
  }), parse_safeParse = _safeParse(ZodRealError), parse_safeParseAsync = _safeParseAsync(ZodRealError), ZodType = $constructor("ZodType", (inst, def)=>($ZodType.init(inst, def), inst.def = def, Object.defineProperty(inst, "_def", {
@@ -6432,9 +6235,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6432
6235
  }
6433
6236
  } : ch)
6434
6237
  ]
6435
- }), inst.clone = (def, params)=>clone(inst, def, params), inst.brand = ()=>inst, inst.register = (reg, meta)=>(reg.add(inst, meta), inst), inst.parse = (data, params)=>classic_parse_parse(inst, data, params, {
6238
+ }), inst.clone = (def, params)=>clone(inst, def, params), inst.brand = ()=>inst, inst.register = (reg, meta)=>(reg.add(inst, meta), inst), inst.parse = (data, params)=>parse_parse(inst, data, params, {
6436
6239
  callee: inst.parse
6437
- }), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>classic_parse_parseAsync(inst, data, params, {
6240
+ }), inst.safeParse = (data, params)=>parse_safeParse(inst, data, params), inst.parseAsync = async (data, params)=>parse_parseAsync(inst, data, params, {
6438
6241
  callee: inst.parseAsync
6439
6242
  }), inst.safeParseAsync = async (data, params)=>parse_safeParseAsync(inst, data, params), inst.spa = inst.safeParseAsync, inst.refine = (check, params)=>inst.check(function(fn, _params = {}) {
6440
6243
  return new ZodCustom({
@@ -6443,41 +6246,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6443
6246
  fn: fn,
6444
6247
  ...normalizeParams(_params)
6445
6248
  });
6446
- }(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn, params) {
6447
- let ch = function(fn, params) {
6249
+ }(check, params)), inst.superRefine = (refinement)=>inst.check(function(fn) {
6250
+ let ch = function(fn) {
6448
6251
  let ch = new $ZodCheck({
6449
- check: "custom",
6450
- ...normalizeParams(params)
6252
+ check: "custom"
6451
6253
  });
6452
6254
  return ch._zod.check = fn, ch;
6453
6255
  }((payload)=>(payload.addIssue = (issue)=>{
6454
6256
  "string" == typeof issue ? payload.issues.push(util_issue(issue, payload.value, ch._zod.def)) : (issue.fatal && (issue.continue = !1), issue.code ?? (issue.code = "custom"), issue.input ?? (issue.input = payload.value), issue.inst ?? (issue.inst = ch), issue.continue ?? (issue.continue = !ch._zod.def.abort), payload.issues.push(util_issue(issue)));
6455
- }, fn(payload.value, payload)), void 0);
6257
+ }, fn(payload.value, payload)));
6456
6258
  return ch;
6457
- }(refinement)), inst.overwrite = (fn)=>inst.check(_overwrite(fn)), inst.optional = ()=>schemas_optional(inst), inst.nullable = ()=>nullable(inst), inst.nullish = ()=>schemas_optional(nullable(inst)), inst.nonoptional = (params)=>{
6458
- var innerType, params1;
6459
- return new ZodNonOptional({
6259
+ }(refinement)), inst.overwrite = (fn)=>inst.check(_overwrite(fn)), inst.optional = ()=>schemas_optional(inst), inst.nullable = ()=>nullable(inst), inst.nullish = ()=>schemas_optional(nullable(inst)), inst.nonoptional = (params)=>new ZodNonOptional({
6460
6260
  type: "nonoptional",
6461
- innerType: innerType = inst,
6462
- ...normalizeParams(params1 = params)
6463
- });
6464
- }, inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
6261
+ innerType: inst,
6262
+ ...normalizeParams(params)
6263
+ }), inst.array = ()=>schemas_array(inst), inst.or = (arg)=>union([
6465
6264
  inst,
6466
6265
  arg
6467
- ]), inst.and = (arg)=>{
6468
- var left, right;
6469
- return new ZodIntersection({
6266
+ ]), inst.and = (arg)=>new ZodIntersection({
6470
6267
  type: "intersection",
6471
- left: left = inst,
6472
- right: right = arg
6473
- });
6474
- }, inst.transform = (tx)=>{
6475
- var fn;
6476
- return pipe(inst, new ZodTransform({
6268
+ left: inst,
6269
+ right: arg
6270
+ }), inst.transform = (tx)=>pipe(inst, new ZodTransform({
6477
6271
  type: "transform",
6478
- transform: fn = tx
6479
- }));
6480
- }, inst.default = (def)=>{
6272
+ transform: tx
6273
+ })), inst.default = (def)=>{
6481
6274
  var innerType, defaultValue;
6482
6275
  return innerType = inst, defaultValue = def, new ZodDefault({
6483
6276
  type: "default",
@@ -6496,30 +6289,27 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6496
6289
  }
6497
6290
  });
6498
6291
  }, inst.catch = (params)=>{
6499
- var innerType, catchValue;
6292
+ var catchValue;
6500
6293
  return new ZodCatch({
6501
6294
  type: "catch",
6502
- innerType: innerType = inst,
6295
+ innerType: inst,
6503
6296
  catchValue: "function" == typeof (catchValue = params) ? catchValue : ()=>catchValue
6504
6297
  });
6505
- }, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>{
6506
- var innerType;
6507
- return new ZodReadonly({
6298
+ }, inst.pipe = (target)=>pipe(inst, target), inst.readonly = ()=>new ZodReadonly({
6508
6299
  type: "readonly",
6509
- innerType: innerType = inst
6510
- });
6511
- }, inst.describe = (description)=>{
6300
+ innerType: inst
6301
+ }), inst.describe = (description)=>{
6512
6302
  let cl = inst.clone();
6513
- return registries_globalRegistry.add(cl, {
6303
+ return globalRegistry.add(cl, {
6514
6304
  description
6515
6305
  }), cl;
6516
6306
  }, Object.defineProperty(inst, "description", {
6517
- get: ()=>registries_globalRegistry.get(inst)?.description,
6307
+ get: ()=>globalRegistry.get(inst)?.description,
6518
6308
  configurable: !0
6519
6309
  }), inst.meta = (...args)=>{
6520
- if (0 === args.length) return registries_globalRegistry.get(inst);
6310
+ if (0 === args.length) return globalRegistry.get(inst);
6521
6311
  let cl = inst.clone();
6522
- return registries_globalRegistry.add(cl, args[0]), cl;
6312
+ return globalRegistry.add(cl, args[0]), cl;
6523
6313
  }, inst.isOptional = ()=>inst.safeParse(void 0).success, inst.isNullable = ()=>inst.safeParse(null).success, inst)), _ZodString = $constructor("_ZodString", (inst, def)=>{
6524
6314
  $ZodString.init(inst, def), ZodType.init(inst, def);
6525
6315
  let bag = inst._zod.bag;
@@ -6692,43 +6482,31 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6692
6482
  check: "string_format",
6693
6483
  abort: !1,
6694
6484
  ...normalizeParams(params)
6695
- })), inst.datetime = (params)=>{
6696
- var params1;
6697
- return inst.check(new ZodISODateTime({
6485
+ })), inst.datetime = (params)=>inst.check(new ZodISODateTime({
6698
6486
  type: "string",
6699
6487
  format: "datetime",
6700
6488
  check: "string_format",
6701
6489
  offset: !1,
6702
6490
  local: !1,
6703
6491
  precision: null,
6704
- ...normalizeParams(params1 = params)
6705
- }));
6706
- }, inst.date = (params)=>{
6707
- var params1;
6708
- return inst.check(new ZodISODate({
6492
+ ...normalizeParams(params)
6493
+ })), inst.date = (params)=>inst.check(new ZodISODate({
6709
6494
  type: "string",
6710
6495
  format: "date",
6711
6496
  check: "string_format",
6712
- ...normalizeParams(params1 = params)
6713
- }));
6714
- }, inst.time = (params)=>{
6715
- var params1;
6716
- return inst.check(new ZodISOTime({
6497
+ ...normalizeParams(params)
6498
+ })), inst.time = (params)=>inst.check(new ZodISOTime({
6717
6499
  type: "string",
6718
6500
  format: "time",
6719
6501
  check: "string_format",
6720
6502
  precision: null,
6721
- ...normalizeParams(params1 = params)
6722
- }));
6723
- }, inst.duration = (params)=>{
6724
- var params1;
6725
- return inst.check(new ZodISODuration({
6503
+ ...normalizeParams(params)
6504
+ })), inst.duration = (params)=>inst.check(new ZodISODuration({
6726
6505
  type: "string",
6727
6506
  format: "duration",
6728
6507
  check: "string_format",
6729
- ...normalizeParams(params1 = params)
6508
+ ...normalizeParams(params)
6730
6509
  }));
6731
- };
6732
6510
  });
6733
6511
  function schemas_string(params) {
6734
6512
  return new ZodString({
@@ -6779,7 +6557,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6779
6557
  }), ZodNumber = $constructor("ZodNumber", (inst, def)=>{
6780
6558
  $ZodNumber.init(inst, def), ZodType.init(inst, def), inst.gt = (value, params)=>inst.check(_gt(value, params)), inst.gte = (value, params)=>inst.check(_gte(value, params)), inst.min = (value, params)=>inst.check(_gte(value, params)), inst.lt = (value, params)=>inst.check(_lt(value, params)), inst.lte = (value, params)=>inst.check(_lte(value, params)), inst.max = (value, params)=>inst.check(_lte(value, params)), inst.int = (params)=>inst.check(schemas_int(params)), inst.safe = (params)=>inst.check(schemas_int(params)), inst.positive = (params)=>inst.check(_gt(0, params)), inst.nonnegative = (params)=>inst.check(_gte(0, params)), inst.negative = (params)=>inst.check(_lt(0, params)), inst.nonpositive = (params)=>inst.check(_lte(0, params)), inst.multipleOf = (value, params)=>inst.check(_multipleOf(value, params)), inst.step = (value, params)=>inst.check(_multipleOf(value, params)), inst.finite = ()=>inst;
6781
6559
  let bag = inst._zod.bag;
6782
- inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5), inst.isFinite = !0, inst.format = bag.format ?? null;
6560
+ inst.minValue = Math.max(bag.minimum ?? -1 / 0, bag.exclusiveMinimum ?? -1 / 0) ?? null, inst.maxValue = Math.min(bag.maximum ?? 1 / 0, bag.exclusiveMaximum ?? 1 / 0) ?? null, inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5), inst.isFinite = !0, inst.format = bag.format ?? null;
6783
6561
  });
6784
6562
  function schemas_number(params) {
6785
6563
  return new ZodNumber({
@@ -6849,15 +6627,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6849
6627
  $ZodArray.init(inst, def), ZodType.init(inst, def), inst.element = def.element, inst.min = (minLength, params)=>inst.check(_minLength(minLength, params)), inst.nonempty = (params)=>inst.check(_minLength(1, params)), inst.max = (maxLength, params)=>inst.check(_maxLength(maxLength, params)), inst.length = (len, params)=>inst.check(_length(len, params)), inst.unwrap = ()=>inst.element;
6850
6628
  });
6851
6629
  function schemas_array(element, params) {
6852
- var Class;
6853
- return new (Class = ZodArray)({
6630
+ return new ZodArray({
6854
6631
  type: "array",
6855
6632
  element: element,
6856
6633
  ...normalizeParams(params)
6857
6634
  });
6858
6635
  }
6859
6636
  let ZodObject = $constructor("ZodObject", (inst, def)=>{
6860
- $ZodObject.init(inst, def), ZodType.init(inst, def), defineLazy(inst, "shape", ()=>Object.fromEntries(Object.entries(inst._zod.def.shape))), inst.keyof = ()=>schemas_enum(Object.keys(inst._zod.def.shape)), inst.catchall = (catchall)=>inst.clone({
6637
+ $ZodObject.init(inst, def), ZodType.init(inst, def), defineLazy(inst, "shape", ()=>def.shape), inst.keyof = ()=>schemas_enum(Object.keys(inst._zod.def.shape)), inst.catchall = (catchall)=>inst.clone({
6861
6638
  ...inst._zod.def,
6862
6639
  catchall: catchall
6863
6640
  }), inst.passthrough = ()=>inst.clone({
@@ -6873,6 +6650,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
6873
6650
  ...inst._zod.def,
6874
6651
  catchall: void 0
6875
6652
  }), inst.extend = (incoming)=>(function(schema, shape) {
6653
+ if (!isPlainObject(shape)) throw Error("Invalid input to extend: expected a plain object");
6876
6654
  let def = {
6877
6655
  ...schema._zod.def,
6878
6656
  get shape () {
@@ -7001,7 +6779,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7001
6779
  let ZodIntersection = $constructor("ZodIntersection", (inst, def)=>{
7002
6780
  $ZodIntersection.init(inst, def), ZodType.init(inst, def);
7003
6781
  }), ZodTuple = $constructor("ZodTuple", (inst, def)=>{
7004
- schemas_$ZodTuple.init(inst, def), ZodType.init(inst, def), inst.rest = (rest)=>inst.clone({
6782
+ $ZodTuple.init(inst, def), ZodType.init(inst, def), inst.rest = (rest)=>inst.clone({
7005
6783
  ...inst._zod.def,
7006
6784
  rest: rest
7007
6785
  });
@@ -7160,14 +6938,38 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7160
6938
  });
7161
6939
  return inst._zod.bag.Class = cls, inst;
7162
6940
  }
7163
- Object.freeze({
7164
- status: "aborted"
7165
- }), core_config({
7166
- localeError: en_error()
7167
- });
7168
- let numberOrInfinity = schemas_number().or(literal(Number.POSITIVE_INFINITY)), anyFunction = custom((data)=>"function" == typeof data, {
6941
+ let numberOrInfinity = schemas_number().or(literal(1 / 0)), anyFunction = custom((data)=>"function" == typeof data, {
7169
6942
  error: (input)=>({
7170
- message: `Expected function, received ${getParsedType(input)}`
6943
+ message: `Expected function, received ${((data)=>{
6944
+ let t = typeof data;
6945
+ switch(t){
6946
+ case "undefined":
6947
+ return "undefined";
6948
+ case "string":
6949
+ return "string";
6950
+ case "number":
6951
+ return Number.isNaN(data) ? "nan" : "number";
6952
+ case "boolean":
6953
+ return "boolean";
6954
+ case "function":
6955
+ return "function";
6956
+ case "bigint":
6957
+ return "bigint";
6958
+ case "symbol":
6959
+ return "symbol";
6960
+ case "object":
6961
+ if (Array.isArray(data)) return "array";
6962
+ if (null === data) return "null";
6963
+ if (data.then && "function" == typeof data.then && data.catch && "function" == typeof data.catch) return "promise";
6964
+ if ("undefined" != typeof Map && data instanceof Map) return "map";
6965
+ if ("undefined" != typeof Set && data instanceof Set) return "set";
6966
+ if ("undefined" != typeof Date && data instanceof Date) return "date";
6967
+ if ("undefined" != typeof File && data instanceof File) return "file";
6968
+ return "object";
6969
+ default:
6970
+ throw Error(`Unknown data type: ${t}`);
6971
+ }
6972
+ })(input)}`
7171
6973
  })
7172
6974
  }), getIgnorePluginOptionsSchema = memoize(()=>union([
7173
6975
  schemas_object({
@@ -7497,29 +7299,29 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7497
7299
  message: `value must be in ${issue.format} format`
7498
7300
  };
7499
7301
  default:
7500
- var issue1, issue2, issue3, issue4, issue5, issue6, issue7, issue8;
7501
- if ("starts_with" === (issue1 = issue).format) {
7302
+ var issue1, issue2, issue3;
7303
+ if ("starts_with" === issue.format) {
7502
7304
  return {
7503
- type: (issue2 = issue).code,
7504
- path: issue2.path,
7505
- message: `value must start with "${issue2.prefix}"`
7305
+ type: (issue1 = issue).code,
7306
+ path: issue1.path,
7307
+ message: `value must start with "${issue1.prefix}"`
7506
7308
  };
7507
7309
  }
7508
- if ("ends_with" === (issue3 = issue).format) {
7310
+ if ("ends_with" === issue.format) {
7509
7311
  return {
7510
- type: (issue4 = issue).code,
7511
- path: issue4.path,
7512
- message: `value must end with "${issue4.suffix}"`
7312
+ type: (issue2 = issue).code,
7313
+ path: issue2.path,
7314
+ message: `value must end with "${issue2.suffix}"`
7513
7315
  };
7514
7316
  }
7515
- if ("includes" === (issue5 = issue).format) {
7317
+ if ("includes" === issue.format) {
7516
7318
  return {
7517
- type: (issue6 = issue).code,
7518
- path: issue6.path,
7519
- message: `value must include "${issue6.includes}"`
7319
+ type: (issue3 = issue).code,
7320
+ path: issue3.path,
7321
+ message: `value must include "${issue3.includes}"`
7520
7322
  };
7521
7323
  }
7522
- if ("regex" === (issue7 = issue).format) return function(issue, options = {
7324
+ if ("regex" === issue.format) return function(issue, options = {
7523
7325
  displayInvalidFormatDetails: !1
7524
7326
  }) {
7525
7327
  let message = "value must match pattern";
@@ -7529,7 +7331,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7529
7331
  message
7530
7332
  };
7531
7333
  }(issue, options);
7532
- if ("jwt" === (issue8 = issue).format) return function(issue, options = {
7334
+ if ("jwt" === issue.format) return function(issue, options = {
7533
7335
  displayInvalidFormatDetails: !1
7534
7336
  }) {
7535
7337
  return {
@@ -7663,10 +7465,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7663
7465
  }
7664
7466
  return path.reduce((acc, propertyKey)=>{
7665
7467
  if ("number" == typeof propertyKey) return acc + "[" + propertyKey.toString() + "]";
7666
- if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"')) {
7667
- var str;
7668
- return acc + '["' + (str = propertyKey).replace(/"/g, '\\"') + '"]';
7669
- }
7468
+ if ("symbol" == typeof propertyKey && (propertyKey = stringifySymbol(propertyKey)), propertyKey.includes('"')) return acc + '["' + propertyKey.replace(/"/g, '\\"') + '"]';
7670
7469
  if (!identifierRegex.test(propertyKey)) return acc + '["' + propertyKey + '"]';
7671
7470
  let separator = 0 === acc.length ? "" : ".";
7672
7471
  return acc + separator + propertyKey;
@@ -7689,7 +7488,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7689
7488
  }
7690
7489
  function fromZodErrorWithoutRuntimeCheck(zodError, options = {}) {
7691
7490
  var options1;
7692
- let message, zodIssues = zodError.issues;
7491
+ let zodIssues = zodError.issues;
7693
7492
  return new ValidationError(isNonEmptyArray(zodIssues) ? ("messageBuilder" in (options1 = options) ? options1.messageBuilder : function(partialOptions = {}) {
7694
7493
  let options = {
7695
7494
  ...defaultMessageBuilderOptions,
@@ -7706,11 +7505,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7706
7505
  cause: zodError
7707
7506
  });
7708
7507
  }
7709
- var toValidationError = (options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
7710
- cause: err
7711
- }) : new ValidationError("Unknown error");
7712
7508
  function fromError(err, options = {}) {
7713
- return toValidationError(options)(err);
7509
+ return ((options = {})=>(err)=>isZodErrorLike(err) ? fromZodErrorWithoutRuntimeCheck(err, options) : err instanceof Error ? new ValidationError(err.message, {
7510
+ cause: err
7511
+ }) : new ValidationError("Unknown error"))(options)(err);
7714
7512
  }
7715
7513
  class validate_ValidationError extends Error {
7716
7514
  constructor(message){
@@ -7757,16 +7555,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7757
7555
  return !1;
7758
7556
  }
7759
7557
  }
7760
- let compilationOptionsMap = new WeakMap(), getPluginOptions = (compilation, uid)=>{
7761
- if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
7762
- return compilationOptionsMap.get(compilation)?.[uid];
7763
- }, setPluginOptions = (compilation, uid, options)=>{
7764
- let optionsMap = compilationOptionsMap.get(compilation) || {};
7765
- optionsMap[uid] = options, compilationOptionsMap.set(compilation, optionsMap);
7766
- }, cleanPluginOptions = (compilation, uid)=>{
7767
- let optionsMap = compilationOptionsMap.get(compilation) || {};
7768
- delete optionsMap[uid], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation) : compilationOptionsMap.set(compilation, optionsMap);
7769
- }, HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
7558
+ let compilationOptionsMap = new WeakMap(), HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
7770
7559
  let templateParameters, templateFn, filenames;
7771
7560
  validate(c, getHtmlPluginOptionsSchema);
7772
7561
  let uid = HTML_PLUGIN_UID++, meta = {};
@@ -7806,9 +7595,14 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7806
7595
  return json;
7807
7596
  }
7808
7597
  this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance)=>{
7809
- setPluginOptions(compilation = compilationInstance, uid, c);
7598
+ var compilation1 = compilation = compilationInstance, uid1 = uid, options = c;
7599
+ let optionsMap = compilationOptionsMap.get(compilation1) || {};
7600
+ optionsMap[uid1] = options, compilationOptionsMap.set(compilation1, optionsMap);
7810
7601
  }), this.hooks.done.tap("HtmlRspackPlugin", (stats)=>{
7811
- cleanPluginHooks(stats.compilation), cleanPluginOptions(stats.compilation, uid);
7602
+ compilation = stats.compilation, hooks_compilationHooksMap.delete(compilation);
7603
+ var compilation, compilation1 = stats.compilation, uid1 = uid;
7604
+ let optionsMap = compilationOptionsMap.get(compilation1) || {};
7605
+ delete optionsMap[uid1], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation1) : compilationOptionsMap.set(compilation1, optionsMap);
7812
7606
  });
7813
7607
  let templateContent = c.templateContent;
7814
7608
  if ("function" == typeof templateContent) templateFn = async (data)=>{
@@ -7947,10 +7741,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7947
7741
  };
7948
7742
  class HttpUriPlugin extends RspackBuiltinPlugin {
7949
7743
  options;
7950
- name;
7951
- affectedHooks;
7744
+ name = binding_.BuiltinPluginName.HttpUriPlugin;
7745
+ affectedHooks = "compilation";
7952
7746
  constructor(options){
7953
- super(), this.options = options, this.name = binding_.BuiltinPluginName.HttpUriPlugin, this.affectedHooks = "compilation";
7747
+ super(), this.options = options;
7954
7748
  }
7955
7749
  raw(compiler) {
7956
7750
  let { options } = this, lockfileLocation = options.lockfileLocation ?? external_node_path_default().join(compiler.context, compiler.name ? `${compiler.name}.rspack.lock` : "rspack.lock"), cacheLocation = !1 === options.cacheLocation ? void 0 : options.cacheLocation ?? `${lockfileLocation}.data`, raw = {
@@ -7987,21 +7781,21 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
7987
7781
  imports,
7988
7782
  entries,
7989
7783
  test
7990
- }), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", getDefaultClient = (compiler)=>require.resolve(`../hot/lazy-compilation-${compiler.options.externalsPresets.node ? "node" : "web"}.js`), noop = (_req, _res, next)=>{
7784
+ }), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
7991
7785
  "function" == typeof next && next();
7992
- }, getFullServerUrl = ({ serverUrl, prefix })=>{
7993
- let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
7994
- return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
7995
7786
  };
7996
7787
  function applyPlugin(compiler, moduleToIndex, indexToModule, options, activeModules, filesByKey) {
7997
7788
  new BuiltinLazyCompilationPlugin(({ module, path })=>{
7998
- let index = moduleToIndex.get(module);
7789
+ let compiler1, index = moduleToIndex.get(module);
7999
7790
  void 0 === index && (index = moduleToIndex.size.toString(), moduleToIndex.set(module, index), indexToModule.set(index, module));
8000
7791
  let key = indexToModule.get(index);
8001
7792
  filesByKey.set(key, path);
8002
7793
  let active = !0 === activeModules.get(key);
8003
7794
  return {
8004
- client: `${options.client || getDefaultClient(compiler)}?${encodeURIComponent(getFullServerUrl(options))}`,
7795
+ client: `${options.client || (compiler1 = compiler, require.resolve(`../hot/lazy-compilation-${compiler1.options.externalsPresets.node ? "node" : "web"}.js`))}?${encodeURIComponent((({ serverUrl, prefix })=>{
7796
+ let lazyCompilationPrefix = prefix || LAZY_COMPILATION_PREFIX;
7797
+ return serverUrl ? serverUrl + (serverUrl.endsWith("/") ? lazyCompilationPrefix.slice(1) : lazyCompilationPrefix) : lazyCompilationPrefix;
7798
+ })(options))}`,
8005
7799
  data: index,
8006
7800
  active
8007
7801
  };
@@ -8029,10 +7823,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8029
7823
  }, LimitChunkCountPlugin = base_create(binding_.BuiltinPluginName.LimitChunkCountPlugin, (options)=>options);
8030
7824
  class MangleExportsPlugin extends RspackBuiltinPlugin {
8031
7825
  deterministic;
8032
- name;
8033
- affectedHooks;
7826
+ name = binding_.BuiltinPluginName.MangleExportsPlugin;
7827
+ affectedHooks = "compilation";
8034
7828
  constructor(deterministic){
8035
- super(), this.deterministic = deterministic, this.name = binding_.BuiltinPluginName.MangleExportsPlugin, this.affectedHooks = "compilation";
7829
+ super(), this.deterministic = deterministic;
8036
7830
  }
8037
7831
  raw(compiler) {
8038
7832
  return createBuiltinPlugin(this.name, this.deterministic);
@@ -8091,29 +7885,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8091
7885
  ])
8092
7886
  }, RuntimePlugin_compilationHooksMap.set(compilation, hooks)), hooks;
8093
7887
  };
8094
- let createRuntimePluginHooksRegisters = (getCompiler, createTap, createMapTap)=>({
8095
- registerRuntimePluginCreateScriptTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
8096
- return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).createScript;
8097
- }, function(queried) {
8098
- return function(data) {
8099
- return queried.call(data.code, data.chunk);
8100
- };
8101
- }),
8102
- registerRuntimePluginLinkPreloadTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
8103
- return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPreload;
8104
- }, function(queried) {
8105
- return function(data) {
8106
- return queried.call(data.code, data.chunk);
8107
- };
8108
- }),
8109
- registerRuntimePluginLinkPrefetchTaps: createTap(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
8110
- return RuntimePlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).linkPrefetch;
8111
- }, function(queried) {
8112
- return function(data) {
8113
- return queried.call(data.code, data.chunk);
8114
- };
8115
- })
8116
- }), SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
7888
+ let SideEffectsFlagPlugin = base_create(binding_.BuiltinPluginName.SideEffectsFlagPlugin, ()=>{}, "compilation"), SizeLimitsPlugin = base_create(binding_.BuiltinPluginName.SizeLimitsPlugin, (options)=>{
8117
7889
  let hints = !1 === options.hints ? void 0 : options.hints;
8118
7890
  return {
8119
7891
  ...options,
@@ -8129,10 +7901,10 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8129
7901
  }
8130
7902
  class SplitChunksPlugin extends RspackBuiltinPlugin {
8131
7903
  options;
8132
- name;
8133
- affectedHooks;
7904
+ name = binding_.BuiltinPluginName.SplitChunksPlugin;
7905
+ affectedHooks = "thisCompilation";
8134
7906
  constructor(options){
8135
- super(), this.options = options, this.name = binding_.BuiltinPluginName.SplitChunksPlugin, this.affectedHooks = "thisCompilation";
7907
+ super(), this.options = options;
8136
7908
  }
8137
7909
  raw(compiler) {
8138
7910
  let rawOptions = function(sc, compiler) {
@@ -8275,9 +8047,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8275
8047
  wasmLoading;
8276
8048
  module;
8277
8049
  workerPublicPath;
8278
- name;
8050
+ name = binding_.BuiltinPluginName.WorkerPlugin;
8279
8051
  constructor(chunkLoading, wasmLoading, module, workerPublicPath){
8280
- super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath, this.name = binding_.BuiltinPluginName.WorkerPlugin;
8052
+ super(), this.chunkLoading = chunkLoading, this.wasmLoading = wasmLoading, this.module = module, this.workerPublicPath = workerPublicPath;
8281
8053
  }
8282
8054
  raw(compiler) {
8283
8055
  return this.chunkLoading && new EnableChunkLoadingPlugin(this.chunkLoading).apply(compiler), this.wasmLoading && new EnableWasmLoadingPlugin(this.wasmLoading).apply(compiler), createBuiltinPlugin(this.name, void 0);
@@ -8332,43 +8104,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8332
8104
  ])
8333
8105
  }, RsdoctorPlugin_compilationHooksMap.set(compilation, hooks)), hooks;
8334
8106
  };
8335
- let createRsdoctorPluginHooksRegisters = (getCompiler, createTap, createMapTap)=>({
8336
- registerRsdoctorPluginModuleGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
8337
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleGraph;
8338
- }, function(queried) {
8339
- return async function(data) {
8340
- return await queried.promise(data);
8341
- };
8342
- }),
8343
- registerRsdoctorPluginChunkGraphTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
8344
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkGraph;
8345
- }, function(queried) {
8346
- return async function(data) {
8347
- return await queried.promise(data);
8348
- };
8349
- }),
8350
- registerRsdoctorPluginModuleIdsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
8351
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleIds;
8352
- }, function(queried) {
8353
- return async function(data) {
8354
- return await queried.promise(data);
8355
- };
8356
- }),
8357
- registerRsdoctorPluginModuleSourcesTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
8358
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).moduleSources;
8359
- }, function(queried) {
8360
- return async function(data) {
8361
- return await queried.promise(data);
8362
- };
8363
- }),
8364
- registerRsdoctorPluginAssetsTaps: createTap(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
8365
- return RsdoctorPluginImpl.getCompilationHooks(getCompiler().__internal__get_compilation()).assets;
8366
- }, function(queried) {
8367
- return async function(data) {
8368
- return await queried.promise(data);
8369
- };
8370
- })
8371
- }), SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
8107
+ let SubresourceIntegrityPlugin_PLUGIN_NAME = "SubresourceIntegrityPlugin", NATIVE_HTML_PLUGIN = "HtmlRspackPlugin", NativeSubresourceIntegrityPlugin = base_create(binding_.BuiltinPluginName.SubresourceIntegrityPlugin, function(options) {
8372
8108
  let htmlPlugin = "Disabled";
8373
8109
  return options.htmlPlugin === NATIVE_HTML_PLUGIN ? htmlPlugin = "Native" : "string" == typeof options.htmlPlugin && (htmlPlugin = "JavaScript"), {
8374
8110
  hashFuncNames: options.hashFuncNames,
@@ -8693,8 +8429,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
8693
8429
  let requiredVersion = versions[name];
8694
8430
  if (!requiredVersion) return !1;
8695
8431
  let [parsedMajor, parserMinor] = "TP" === parsedVersion ? [
8696
- Number.POSITIVE_INFINITY,
8697
- Number.POSITIVE_INFINITY
8432
+ 1 / 0,
8433
+ 1 / 0
8698
8434
  ] : parsedVersion.includes("-") ? parsedVersion.split("-")[0].split(".") : parsedVersion.split(".");
8699
8435
  return "number" == typeof requiredVersion ? +parsedMajor >= requiredVersion : requiredVersion[0] === +parsedMajor ? +parserMinor >= requiredVersion[1] : +parsedMajor > requiredVersion[0];
8700
8436
  }), anyNode = browsers.some((b)=>b.startsWith("node ")), anyBrowser = browsers.some((b)=>/^(?!node)/.test(b)), browserProperty = !!anyBrowser && (!anyNode || null), nodeProperty = !!anyNode && (!anyBrowser || null), es6DynamicImport = rawChecker({
@@ -9086,7 +8822,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
9086
8822
  }, getBrowserslistTargetHandler = memoize(()=>browserslistTargetHandler_namespaceObject), hasBrowserslistConfig = (context)=>{
9087
8823
  let { findConfig } = __webpack_require__("browserslist-load-config");
9088
8824
  return !!findConfig(context);
9089
- }, getDefaultTarget = (context)=>hasBrowserslistConfig(context) ? "browserslist" : "web", versionDependent = (major, minor)=>{
8825
+ }, versionDependent = (major, minor)=>{
9090
8826
  if (!major) return ()=>void 0;
9091
8827
  let nMajor = +major, nMinor = minor ? +minor : 0;
9092
8828
  return (vMajor, vMinor = 0)=>nMajor > vMajor || nMajor === vMajor && nMinor >= vMinor;
@@ -9286,27 +9022,28 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9286
9022
  }
9287
9023
  }
9288
9024
  throw Error(`Unknown target '${target}'. The following targets are supported:\n${TARGETS.map(([name, description])=>`* ${name}: ${description}`).join("\n")}`);
9289
- }, mergeTargetProperties = (targetProperties)=>{
9290
- let keys = new Set();
9291
- for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
9292
- let result = {};
9293
- for (let key of keys){
9294
- let hasTrue = !1, hasFalse = !1;
9295
- for (let tp of targetProperties)switch(tp[key]){
9296
- case !0:
9297
- hasTrue = !0;
9298
- break;
9299
- case !1:
9300
- hasFalse = !0;
9301
- }
9302
- (hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
9303
- }
9304
- return result;
9305
- }, getTargetsProperties = (targets, context)=>mergeTargetProperties(targets.map((t)=>getTargetProperties(t, context))), applyRspackOptionsDefaults = (options)=>{
9306
- defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>getDefaultTarget(options.context));
9025
+ }, applyRspackOptionsDefaults = (options)=>{
9026
+ let targets, context;
9027
+ defaults_F(options, "context", ()=>process.cwd()), defaults_F(options, "target", ()=>hasBrowserslistConfig(options.context) ? "browserslist" : "web");
9307
9028
  let { mode, target } = options;
9308
9029
  external_node_assert_default()(!isNil(target));
9309
- let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : getTargetsProperties(target, options.context)), development = "development" === mode, production = "production" === mode || !mode;
9030
+ let targetProperties = !1 !== target && ("string" == typeof target ? getTargetProperties(target, options.context) : (targets = target, context = options.context, ((targetProperties)=>{
9031
+ let keys = new Set();
9032
+ for (let tp of targetProperties)for (let key of Object.keys(tp))keys.add(key);
9033
+ let result = {};
9034
+ for (let key of keys){
9035
+ let hasTrue = !1, hasFalse = !1;
9036
+ for (let tp of targetProperties)switch(tp[key]){
9037
+ case !0:
9038
+ hasTrue = !0;
9039
+ break;
9040
+ case !1:
9041
+ hasFalse = !0;
9042
+ }
9043
+ (hasTrue || hasFalse) && (result[key] = hasFalse && hasTrue ? null : hasTrue);
9044
+ }
9045
+ return result;
9046
+ })(targets.map((t)=>getTargetProperties(t, context))))), development = "development" === mode, production = "production" === mode || !mode;
9310
9047
  if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))defaults_F(options.entry[key], "import", ()=>[
9311
9048
  "./src"
9312
9049
  ]);
@@ -9350,8 +9087,6 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9350
9087
  mode: options.mode,
9351
9088
  css: options.experiments.css
9352
9089
  }), options.resolve), options.resolveLoader = cleverMerge(getResolveLoaderDefaults(), options.resolveLoader);
9353
- }, applyRspackOptionsBaseDefaults = (options)=>{
9354
- defaults_F(options, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging);
9355
9090
  }, applyInfrastructureLoggingDefaults = (infrastructureLogging)=>{
9356
9091
  defaults_F(infrastructureLogging, "stream", ()=>process.stderr);
9357
9092
  let tty = infrastructureLogging.stream.isTTY && "dumb" !== process.env.TERM;
@@ -9359,15 +9094,12 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9359
9094
  }, applyExperimentsDefaults = (experiments, { production, development })=>{
9360
9095
  defaults_F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !0), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !1), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1);
9361
9096
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
9362
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7-alpha.0"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
9363
- }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyJavascriptParserOptionsDefaults = (parserOptions)=>{
9364
- D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
9097
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.4.7-alpha.1"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
9098
+ }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
9099
+ var parserOptions;
9100
+ if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), D(parserOptions = module.parser.javascript, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
9365
9101
  "..."
9366
- ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant");
9367
- }, applyJsonGeneratorOptionsDefaults = (generatorOptions)=>{
9368
- D(generatorOptions, "JSONParse", !0);
9369
- }, applyModuleDefaults = (module, { asyncWebAssembly, css, targetProperties, mode, uniqueName })=>{
9370
- if (assertNotNill(module.parser), assertNotNill(module.generator), defaults_F(module.parser, "asset", ()=>({})), assertNotNill(module.parser.asset), defaults_F(module.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module.parser.asset.dataUrlCondition && D(module.parser.asset.dataUrlCondition, "maxSize", 8096), defaults_F(module.parser, "javascript", ()=>({})), assertNotNill(module.parser.javascript), applyJavascriptParserOptionsDefaults(module.parser.javascript), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), applyJsonGeneratorOptionsDefaults(module.generator.json), css) {
9102
+ ]), D(parserOptions, "importMeta", !0), D(parserOptions, "inlineConst", !1), D(parserOptions, "typeReexportsPresence", "no-tolerant"), defaults_F(module.parser, JSON_MODULE_TYPE, ()=>({})), assertNotNill(module.parser[JSON_MODULE_TYPE]), D(module.parser[JSON_MODULE_TYPE], "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), defaults_F(module.generator, "json", ()=>({})), assertNotNill(module.generator.json), D(module.generator.json, "JSONParse", !0), css) {
9371
9103
  defaults_F(module.parser, "css", ()=>({})), assertNotNill(module.parser.css), D(module.parser.css, "namedExports", !0), D(module.parser.css, "url", !0), defaults_F(module.parser, "css/auto", ()=>({})), assertNotNill(module.parser["css/auto"]), D(module.parser["css/auto"], "namedExports", !0), D(module.parser["css/auto"], "url", !0), defaults_F(module.parser, "css/module", ()=>({})), assertNotNill(module.parser["css/module"]), D(module.parser["css/module"], "namedExports", !0), D(module.parser["css/module"], "url", !0), defaults_F(module.generator, "css", ()=>({})), assertNotNill(module.generator.css), D(module.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator.css, "esModule", !0), defaults_F(module.generator, "css/auto", ()=>({})), assertNotNill(module.generator["css/auto"]), D(module.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/auto"], "exportsConvention", "as-is");
9372
9104
  let localIdentName = uniqueName && uniqueName.length > 0 ? "[uniqueName]-[id]-[local]" : "[id]-[local]";
9373
9105
  D(module.generator["css/auto"], "localIdentName", localIdentName), D(module.generator["css/auto"], "esModule", !0), defaults_F(module.generator, "css/module", ()=>({})), assertNotNill(module.generator["css/module"]), D(module.generator["css/module"], "exportsOnly", !targetProperties || !targetProperties.document), D(module.generator["css/module"], "exportsConvention", "as-is"), D(module.generator["css/module"], "localIdentName", localIdentName), D(module.generator["css/module"], "esModule", !0);
@@ -9507,8 +9239,38 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9507
9239
  return "";
9508
9240
  }
9509
9241
  }), defaults_F(output, "devtoolNamespace", ()=>output.uniqueName), defaults_F(output, "module", ()=>!!outputModule);
9510
- let environment = output.environment, optimistic = (v)=>v || void 0 === v, conditionallyOptimistic = (v, c)=>void 0 === v && c || v;
9511
- defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>tp && optimistic(tp.bigIntLiteral)), defaults_F(environment, "const", ()=>tp && optimistic(tp.const)), defaults_F(environment, "arrowFunction", ()=>tp && optimistic(tp.arrowFunction)), defaults_F(environment, "asyncFunction", ()=>tp && optimistic(tp.asyncFunction)), defaults_F(environment, "forOf", ()=>tp && optimistic(tp.forOf)), defaults_F(environment, "destructuring", ()=>tp && optimistic(tp.destructuring)), defaults_F(environment, "optionalChaining", ()=>tp && optimistic(tp.optionalChaining)), defaults_F(environment, "nodePrefixForCoreModules", ()=>tp && optimistic(tp.nodePrefixForCoreModules)), defaults_F(environment, "templateLiteral", ()=>tp && optimistic(tp.templateLiteral)), defaults_F(environment, "dynamicImport", ()=>conditionallyOptimistic(tp?.dynamicImport, output.module)), defaults_F(environment, "dynamicImportInWorker", ()=>conditionallyOptimistic(tp?.dynamicImportInWorker, output.module)), defaults_F(environment, "module", ()=>conditionallyOptimistic(tp?.module, output.module)), defaults_F(environment, "document", ()=>tp && optimistic(tp.document)), D(output, "filename", output.module ? "[name].mjs" : "[name].js"), defaults_F(output, "iife", ()=>!output.module), defaults_F(output, "chunkFilename", ()=>{
9242
+ let environment = output.environment, conditionallyOptimistic = (v, c)=>void 0 === v && c || v;
9243
+ defaults_F(environment, "globalThis", ()=>tp?.globalThis), defaults_F(environment, "bigIntLiteral", ()=>{
9244
+ let v;
9245
+ return tp && ((v = tp.bigIntLiteral) || void 0 === v);
9246
+ }), defaults_F(environment, "const", ()=>{
9247
+ let v;
9248
+ return tp && ((v = tp.const) || void 0 === v);
9249
+ }), defaults_F(environment, "arrowFunction", ()=>{
9250
+ let v;
9251
+ return tp && ((v = tp.arrowFunction) || void 0 === v);
9252
+ }), defaults_F(environment, "asyncFunction", ()=>{
9253
+ let v;
9254
+ return tp && ((v = tp.asyncFunction) || void 0 === v);
9255
+ }), defaults_F(environment, "forOf", ()=>{
9256
+ let v;
9257
+ return tp && ((v = tp.forOf) || void 0 === v);
9258
+ }), defaults_F(environment, "destructuring", ()=>{
9259
+ let v;
9260
+ return tp && ((v = tp.destructuring) || void 0 === v);
9261
+ }), defaults_F(environment, "optionalChaining", ()=>{
9262
+ let v;
9263
+ return tp && ((v = tp.optionalChaining) || void 0 === v);
9264
+ }), defaults_F(environment, "nodePrefixForCoreModules", ()=>{
9265
+ let v;
9266
+ return tp && ((v = tp.nodePrefixForCoreModules) || void 0 === v);
9267
+ }), defaults_F(environment, "templateLiteral", ()=>{
9268
+ let v;
9269
+ return tp && ((v = tp.templateLiteral) || void 0 === v);
9270
+ }), defaults_F(environment, "dynamicImport", ()=>conditionallyOptimistic(tp?.dynamicImport, output.module)), defaults_F(environment, "dynamicImportInWorker", ()=>conditionallyOptimistic(tp?.dynamicImportInWorker, output.module)), defaults_F(environment, "module", ()=>conditionallyOptimistic(tp?.module, output.module)), defaults_F(environment, "document", ()=>{
9271
+ let v;
9272
+ return tp && ((v = tp.document) || void 0 === v);
9273
+ }), D(output, "filename", output.module ? "[name].mjs" : "[name].js"), defaults_F(output, "iife", ()=>!output.module), defaults_F(output, "chunkFilename", ()=>{
9512
9274
  let filename = output.filename;
9513
9275
  if ("function" != typeof filename) {
9514
9276
  let hasName = filename.includes("[name]"), hasId = filename.includes("[id]"), hasChunkHash = filename.includes("[chunkhash]"), hasContentHash = filename.includes("[contenthash]");
@@ -9632,7 +9394,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9632
9394
  ] : [
9633
9395
  "javascript",
9634
9396
  "unknown"
9635
- ]), D(splitChunks, "hidePathInfo", production), D(splitChunks, "chunks", "async"), D(splitChunks, "usedExports", !0 === optimization.usedExports), D(splitChunks, "minChunks", 1), defaults_F(splitChunks, "minSize", ()=>production ? 20000 : 10000), defaults_F(splitChunks, "maxAsyncRequests", ()=>production ? 30 : Number.POSITIVE_INFINITY), defaults_F(splitChunks, "maxInitialRequests", ()=>production ? 30 : Number.POSITIVE_INFINITY), D(splitChunks, "automaticNameDelimiter", "-");
9397
+ ]), D(splitChunks, "hidePathInfo", production), D(splitChunks, "chunks", "async"), D(splitChunks, "usedExports", !0 === optimization.usedExports), D(splitChunks, "minChunks", 1), defaults_F(splitChunks, "minSize", ()=>production ? 20000 : 10000), defaults_F(splitChunks, "maxAsyncRequests", ()=>production ? 30 : 1 / 0), defaults_F(splitChunks, "maxInitialRequests", ()=>production ? 30 : 1 / 0), D(splitChunks, "automaticNameDelimiter", "-");
9636
9398
  let { cacheGroups } = splitChunks;
9637
9399
  cacheGroups && (defaults_F(cacheGroups, "default", ()=>({
9638
9400
  idHint: "",
@@ -10237,7 +9999,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
10237
9999
  this.suspended && (this.suspended = !1, this.#invalidate());
10238
10000
  }
10239
10001
  }
10240
- let CORE_VERSION = "1.4.7-alpha.0", checkVersion = ()=>CORE_VERSION === binding_.EXPECTED_RSPACK_CORE_VERSION || CORE_VERSION.includes("canary") ? null : Error(bindingVersionCheck_errorMessage(CORE_VERSION, binding_.EXPECTED_RSPACK_CORE_VERSION)), bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10002
+ let CORE_VERSION = "1.4.7-alpha.1", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
10241
10003
 
10242
10004
  Help:
10243
10005
  Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
@@ -10247,89 +10009,7 @@ Help:
10247
10009
  Help:
10248
10010
  Please ensure the version of @rspack/binding and @rspack/core is the same.
10249
10011
  The expected version of @rspack/core to the current binding is ${expectedCoreVersion}.
10250
- `, createHtmlPluginHooksRegisters = (getCompiler, createTap, createMapTap)=>{
10251
- let getOptions = (uid)=>getPluginOptions(getCompiler().__internal__get_compilation(), uid);
10252
- return {
10253
- registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
10254
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
10255
- }, function(queried) {
10256
- return async function(data) {
10257
- let { compilationId, uid } = data, res = await queried.promise({
10258
- ...data,
10259
- plugin: {
10260
- options: getOptions(uid)
10261
- }
10262
- });
10263
- return res.compilationId = compilationId, res.uid = uid, res;
10264
- };
10265
- }),
10266
- registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
10267
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
10268
- }, function(queried) {
10269
- return async function(data) {
10270
- let { compilationId, uid } = data, res = await queried.promise({
10271
- ...data,
10272
- plugin: {
10273
- options: getOptions(uid)
10274
- }
10275
- });
10276
- return res.compilationId = compilationId, res.uid = uid, res;
10277
- };
10278
- }),
10279
- registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
10280
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
10281
- }, function(queried) {
10282
- return async function(data) {
10283
- let { compilationId, uid } = data, res = await queried.promise({
10284
- ...data,
10285
- plugin: {
10286
- options: getOptions(uid)
10287
- }
10288
- });
10289
- return res.compilationId = compilationId, res.uid = uid, res;
10290
- };
10291
- }),
10292
- registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
10293
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
10294
- }, function(queried) {
10295
- return async function(data) {
10296
- let { compilationId, uid } = data, res = await queried.promise({
10297
- ...data,
10298
- plugin: {
10299
- options: getOptions(uid)
10300
- }
10301
- });
10302
- return res.compilationId = compilationId, res;
10303
- };
10304
- }),
10305
- registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
10306
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
10307
- }, function(queried) {
10308
- return async function(data) {
10309
- let { compilationId, uid } = data, res = await queried.promise({
10310
- ...data,
10311
- plugin: {
10312
- options: getOptions(uid)
10313
- }
10314
- });
10315
- return res.compilationId = compilationId, res.uid = uid, res;
10316
- };
10317
- }),
10318
- registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
10319
- return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
10320
- }, function(queried) {
10321
- return async function(data) {
10322
- let { compilationId, uid } = data, res = await queried.promise({
10323
- ...data,
10324
- plugin: {
10325
- options: getOptions(uid)
10326
- }
10327
- });
10328
- return res.compilationId = compilationId, res.uid = uid, res;
10329
- };
10330
- })
10331
- };
10332
- }, RESERVED_RUNTIME_GLOBALS = new Map();
10012
+ `, RESERVED_RUNTIME_GLOBALS = new Map();
10333
10013
  function __from_binding_runtime_globals(runtimeRequirements) {
10334
10014
  let res = new Set();
10335
10015
  for (let flag of runtimeRequirements.value)flag in RuntimeGlobals ? res.add(RuntimeGlobals[flag]) : res.add(flag);
@@ -10418,7 +10098,6 @@ Help:
10418
10098
  asyncModule: "__webpack_require__.a"
10419
10099
  };
10420
10100
  for (let entry of Object.entries(RuntimeGlobals))RESERVED_RUNTIME_GLOBALS.set(entry[1], entry[0]);
10421
- let isReservedRuntimeGlobal = (r)=>RESERVED_RUNTIME_GLOBALS.has(r);
10422
10101
  class CodeGenerationResult {
10423
10102
  #inner;
10424
10103
  constructor(result){
@@ -10428,248 +10107,6 @@ Help:
10428
10107
  return this.#inner.sources[sourceType];
10429
10108
  }
10430
10109
  }
10431
- let createCompilationHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10432
- registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap(binding_.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements, function() {
10433
- return getCompiler().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
10434
- }, function(queried) {
10435
- return function({ chunk, runtimeRequirements }) {
10436
- let set = __from_binding_runtime_globals(runtimeRequirements);
10437
- return queried.call(chunk, set), {
10438
- runtimeRequirements: __to_binding_runtime_globals(set)
10439
- };
10440
- };
10441
- }),
10442
- registerCompilationRuntimeRequirementInTreeTaps: createMapTap(binding_.RegisterJsTapKind.CompilationRuntimeRequirementInTree, function() {
10443
- return getCompiler().__internal__get_compilation().hooks.runtimeRequirementInTree;
10444
- }, function(queried) {
10445
- return function({ chunk, allRuntimeRequirements, runtimeRequirements }) {
10446
- let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
10447
- return all.has(r) ? all : (isReservedRuntimeGlobal(r) || customRuntimeGlobals.add(r), originalAdd(r));
10448
- };
10449
- for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
10450
- for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
10451
- return {
10452
- allRuntimeRequirements: __to_binding_runtime_globals(all)
10453
- };
10454
- };
10455
- }),
10456
- registerCompilationRuntimeModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
10457
- return getCompiler().__internal__get_compilation().hooks.runtimeModule;
10458
- }, function(queried) {
10459
- return function({ module, chunk }) {
10460
- let originSource = module.source?.source;
10461
- queried.call(module, chunk);
10462
- let newSource = module.source?.source;
10463
- if (newSource && newSource !== originSource) return module;
10464
- };
10465
- }),
10466
- registerCompilationBuildModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
10467
- return getCompiler().__internal__get_compilation().hooks.buildModule;
10468
- }, function(queried) {
10469
- return function(module) {
10470
- return queried.call(module);
10471
- };
10472
- }),
10473
- registerCompilationStillValidModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
10474
- return getCompiler().__internal__get_compilation().hooks.stillValidModule;
10475
- }, function(queried) {
10476
- return function(module) {
10477
- return queried.call(module);
10478
- };
10479
- }),
10480
- registerCompilationSucceedModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
10481
- return getCompiler().__internal__get_compilation().hooks.succeedModule;
10482
- }, function(queried) {
10483
- return function(module) {
10484
- return queried.call(module);
10485
- };
10486
- }),
10487
- registerCompilationExecuteModuleTaps: createTap(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
10488
- return getCompiler().__internal__get_compilation().hooks.executeModule;
10489
- }, function(queried) {
10490
- return function({ entry, id, codegenResults, runtimeModules }) {
10491
- try {
10492
- let __nested_webpack_require_4786_4805__ = (id)=>{
10493
- let cached = moduleCache[id];
10494
- if (void 0 !== cached) {
10495
- if (cached.error) throw cached.error;
10496
- return cached.exports;
10497
- }
10498
- let execOptions = {
10499
- id,
10500
- module: {
10501
- id,
10502
- exports: {},
10503
- loaded: !1,
10504
- error: void 0
10505
- },
10506
- require: __nested_webpack_require_4786_4805__
10507
- };
10508
- for (let handler of interceptModuleExecution)handler(execOptions);
10509
- let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
10510
- return id && (moduleCache[id] = moduleObject), tryRunOrWebpackError(()=>queried.call({
10511
- codeGenerationResult: new CodeGenerationResult(result),
10512
- moduleObject
10513
- }, {
10514
- __webpack_require__: __nested_webpack_require_4786_4805__
10515
- }), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
10516
- }, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
10517
- for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
10518
- let executeResult = __nested_webpack_require_4786_4805__(entry);
10519
- getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
10520
- } catch (e) {
10521
- throw getCompiler().__internal__get_module_execution_results_map().set(id, e), e;
10522
- }
10523
- };
10524
- }),
10525
- registerCompilationFinishModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
10526
- return getCompiler().__internal__get_compilation().hooks.finishModules;
10527
- }, function(queried) {
10528
- return async function() {
10529
- return await queried.promise(getCompiler().__internal__get_compilation().modules);
10530
- };
10531
- }),
10532
- registerCompilationOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
10533
- return getCompiler().__internal__get_compilation().hooks.optimizeModules;
10534
- }, function(queried) {
10535
- return function() {
10536
- return queried.call(getCompiler().__internal__get_compilation().modules.values());
10537
- };
10538
- }),
10539
- registerCompilationAfterOptimizeModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
10540
- return getCompiler().__internal__get_compilation().hooks.afterOptimizeModules;
10541
- }, function(queried) {
10542
- return function() {
10543
- queried.call(getCompiler().__internal__get_compilation().modules.values());
10544
- };
10545
- }),
10546
- registerCompilationOptimizeTreeTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
10547
- return getCompiler().__internal__get_compilation().hooks.optimizeTree;
10548
- }, function(queried) {
10549
- return async function() {
10550
- return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
10551
- };
10552
- }),
10553
- registerCompilationOptimizeChunkModulesTaps: createTap(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
10554
- return getCompiler().__internal__get_compilation().hooks.optimizeChunkModules;
10555
- }, function(queried) {
10556
- return async function() {
10557
- return await queried.promise(getCompiler().__internal__get_compilation().chunks, getCompiler().__internal__get_compilation().modules);
10558
- };
10559
- }),
10560
- registerCompilationChunkHashTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
10561
- return getCompiler().__internal__get_compilation().hooks.chunkHash;
10562
- }, function(queried) {
10563
- return function(chunk) {
10564
- let digestResult;
10565
- if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
10566
- let hash = createHash(getCompiler().options.output.hashFunction);
10567
- return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
10568
- };
10569
- }),
10570
- registerCompilationChunkAssetTaps: createTap(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
10571
- return getCompiler().__internal__get_compilation().hooks.chunkAsset;
10572
- }, function(queried) {
10573
- return function({ chunk, filename }) {
10574
- return queried.call(chunk, filename);
10575
- };
10576
- }),
10577
- registerCompilationProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
10578
- return getCompiler().__internal__get_compilation().hooks.processAssets;
10579
- }, function(queried) {
10580
- return async function() {
10581
- return await queried.promise(getCompiler().__internal__get_compilation().assets);
10582
- };
10583
- }),
10584
- registerCompilationAfterProcessAssetsTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
10585
- return getCompiler().__internal__get_compilation().hooks.afterProcessAssets;
10586
- }, function(queried) {
10587
- return function() {
10588
- return queried.call(getCompiler().__internal__get_compilation().assets);
10589
- };
10590
- }),
10591
- registerCompilationSealTaps: createTap(binding_.RegisterJsTapKind.CompilationSeal, function() {
10592
- return getCompiler().__internal__get_compilation().hooks.seal;
10593
- }, function(queried) {
10594
- return function() {
10595
- return queried.call();
10596
- };
10597
- }),
10598
- registerCompilationAfterSealTaps: createTap(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
10599
- return getCompiler().__internal__get_compilation().hooks.afterSeal;
10600
- }, function(queried) {
10601
- return async function() {
10602
- return await queried.promise();
10603
- };
10604
- })
10605
- }), createCompilerHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10606
- registerCompilerThisCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
10607
- return getCompiler().hooks.thisCompilation;
10608
- }, function(queried) {
10609
- return function(native) {
10610
- return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10611
- };
10612
- }),
10613
- registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
10614
- return getCompiler().hooks.compilation;
10615
- }, function(queried) {
10616
- return function() {
10617
- return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10618
- };
10619
- }),
10620
- registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
10621
- return getCompiler().hooks.make;
10622
- }, function(queried) {
10623
- return async function() {
10624
- return await queried.promise(getCompiler().__internal__get_compilation());
10625
- };
10626
- }),
10627
- registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
10628
- return getCompiler().hooks.finishMake;
10629
- }, function(queried) {
10630
- return async function() {
10631
- return await queried.promise(getCompiler().__internal__get_compilation());
10632
- };
10633
- }),
10634
- registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
10635
- return getCompiler().hooks.shouldEmit;
10636
- }, function(queried) {
10637
- return function() {
10638
- return queried.call(getCompiler().__internal__get_compilation());
10639
- };
10640
- }),
10641
- registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
10642
- return getCompiler().hooks.emit;
10643
- }, function(queried) {
10644
- return async function() {
10645
- return await queried.promise(getCompiler().__internal__get_compilation());
10646
- };
10647
- }),
10648
- registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
10649
- return getCompiler().hooks.afterEmit;
10650
- }, function(queried) {
10651
- return async function() {
10652
- return await queried.promise(getCompiler().__internal__get_compilation());
10653
- };
10654
- }),
10655
- registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
10656
- return getCompiler().hooks.assetEmitted;
10657
- }, function(queried) {
10658
- return async function({ filename, targetPath, outputPath }) {
10659
- return queried.promise(filename, {
10660
- compilation: getCompiler().__internal__get_compilation(),
10661
- targetPath,
10662
- outputPath,
10663
- get source () {
10664
- return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
10665
- },
10666
- get content () {
10667
- return this.source?.buffer();
10668
- }
10669
- });
10670
- };
10671
- })
10672
- });
10673
10110
  class ContextModuleFactoryBeforeResolveData {
10674
10111
  #inner;
10675
10112
  static __from_binding(binding) {
@@ -10783,136 +10220,7 @@ Help:
10783
10220
  return this._emitFile(filename, JsSource.__to_binding(source), assetInfo);
10784
10221
  }
10785
10222
  });
10786
- let createContextModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10787
- registerContextModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
10788
- return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
10789
- }, function(queried) {
10790
- return async function(bindingData) {
10791
- let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
10792
- return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
10793
- };
10794
- }),
10795
- registerContextModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
10796
- return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
10797
- }, function(queried) {
10798
- return async function(bindingData) {
10799
- let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
10800
- return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
10801
- };
10802
- })
10803
- }), createJavaScriptModulesHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10804
- registerJavascriptModulesChunkHashTaps: createTap(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
10805
- return JavascriptModulesPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).chunkHash;
10806
- }, function(queried) {
10807
- return function(chunk) {
10808
- let digestResult;
10809
- if (!getCompiler().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
10810
- let hash = createHash(getCompiler().options.output.hashFunction);
10811
- return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler().options.output.hashDigest ? hash.digest(getCompiler().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
10812
- };
10813
- })
10814
- }), createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap)=>({
10815
- registerNormalModuleFactoryBeforeResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
10816
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
10817
- }, function(queried) {
10818
- return async function(resolveData) {
10819
- let normalizedResolveData = {
10820
- contextInfo: {
10821
- issuer: resolveData.issuer,
10822
- issuerLayer: resolveData.issuerLayer ?? null
10823
- },
10824
- request: resolveData.request,
10825
- context: resolveData.context,
10826
- fileDependencies: [],
10827
- missingDependencies: [],
10828
- contextDependencies: []
10829
- }, ret = await queried.promise(normalizedResolveData);
10830
- return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
10831
- ret,
10832
- resolveData
10833
- ];
10834
- };
10835
- }),
10836
- registerNormalModuleFactoryFactorizeTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
10837
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
10838
- }, function(queried) {
10839
- return async function(resolveData) {
10840
- let normalizedResolveData = {
10841
- contextInfo: {
10842
- issuer: resolveData.issuer,
10843
- issuerLayer: resolveData.issuerLayer ?? null
10844
- },
10845
- request: resolveData.request,
10846
- context: resolveData.context,
10847
- fileDependencies: [],
10848
- missingDependencies: [],
10849
- contextDependencies: []
10850
- };
10851
- return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
10852
- };
10853
- }),
10854
- registerNormalModuleFactoryResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
10855
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
10856
- }, function(queried) {
10857
- return async function(resolveData) {
10858
- let normalizedResolveData = {
10859
- contextInfo: {
10860
- issuer: resolveData.issuer,
10861
- issuerLayer: resolveData.issuerLayer ?? null
10862
- },
10863
- request: resolveData.request,
10864
- context: resolveData.context,
10865
- fileDependencies: [],
10866
- missingDependencies: [],
10867
- contextDependencies: []
10868
- };
10869
- return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
10870
- };
10871
- }),
10872
- registerNormalModuleFactoryResolveForSchemeTaps: createMapTap(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
10873
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
10874
- }, function(queried) {
10875
- return async function(args) {
10876
- return [
10877
- await queried.for(args.scheme).promise(args.resourceData),
10878
- args.resourceData
10879
- ];
10880
- };
10881
- }),
10882
- registerNormalModuleFactoryAfterResolveTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
10883
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
10884
- }, function(queried) {
10885
- return async function(arg) {
10886
- let data = {
10887
- contextInfo: {
10888
- issuer: arg.issuer,
10889
- issuerLayer: arg.issuerLayer ?? null
10890
- },
10891
- request: arg.request,
10892
- context: arg.context,
10893
- fileDependencies: arg.fileDependencies,
10894
- missingDependencies: arg.missingDependencies,
10895
- contextDependencies: arg.contextDependencies,
10896
- createData: arg.createData
10897
- };
10898
- return [
10899
- await queried.promise(data),
10900
- data.createData
10901
- ];
10902
- };
10903
- }),
10904
- registerNormalModuleFactoryCreateModuleTaps: createTap(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
10905
- return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
10906
- }, function(queried) {
10907
- return async function(args) {
10908
- let data = {
10909
- ...args,
10910
- settings: {}
10911
- };
10912
- await queried.promise(data, {});
10913
- };
10914
- })
10915
- }), traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
10223
+ let traceHookPlugin_PLUGIN_NAME = "TraceHookPlugin", PLUGIN_PROCESS_NAME = "Plugin Analysis", makeInterceptorFor = (compilerName, tracer)=>(hookName)=>({
10916
10224
  register: (tapInfo)=>{
10917
10225
  let { name, type, fn: internalFn } = tapInfo, newFn = name === traceHookPlugin_PLUGIN_NAME ? internalFn : makeNewTraceTapFn(compilerName, hookName, tracer, {
10918
10226
  name,
@@ -11356,10 +10664,91 @@ Help:
11356
10664
  return this.#compilationParams = params, params;
11357
10665
  }
11358
10666
  #getInstance(callback) {
11359
- let error = checkVersion();
10667
+ let error = CORE_VERSION === binding_.EXPECTED_RSPACK_CORE_VERSION || CORE_VERSION.includes("canary") ? null : Error(bindingVersionCheck_errorMessage(CORE_VERSION, binding_.EXPECTED_RSPACK_CORE_VERSION));
11360
10668
  if (error) return callback(error);
11361
10669
  if (this.#instance) return callback(null, this.#instance);
11362
- let options = this.options, rawOptions = getRawOptions(options, this);
10670
+ let options = this.options, rawOptions = ((options, compiler)=>{
10671
+ var output, module, options1, parser, generator, stats;
10672
+ let mode = options.mode, experiments = options.experiments;
10673
+ return {
10674
+ name: options.name,
10675
+ mode,
10676
+ context: options.context,
10677
+ output: {
10678
+ ...output = options.output,
10679
+ environment: function(environment = {}) {
10680
+ return {
10681
+ const: !!environment.const,
10682
+ arrowFunction: !!environment.arrowFunction,
10683
+ nodePrefixForCoreModules: !!environment.nodePrefixForCoreModules,
10684
+ asyncFunction: !!environment.asyncFunction,
10685
+ bigIntLiteral: !!environment.bigIntLiteral,
10686
+ destructuring: !!environment.destructuring,
10687
+ document: !!environment.document,
10688
+ dynamicImport: !!environment.dynamicImport,
10689
+ forOf: !!environment.forOf,
10690
+ globalThis: !!environment.globalThis,
10691
+ module: !!environment.module,
10692
+ optionalChaining: !!environment.optionalChaining,
10693
+ templateLiteral: !!environment.templateLiteral
10694
+ };
10695
+ }(output.environment)
10696
+ },
10697
+ resolve: getRawResolve(options.resolve),
10698
+ resolveLoader: getRawResolve(options.resolveLoader),
10699
+ module: (module = options.module, options1 = {
10700
+ compiler,
10701
+ mode,
10702
+ context: options.context,
10703
+ experiments
10704
+ }, external_node_assert_default()(!isNil(module.defaultRules), "module.defaultRules should not be nil after defaults"), {
10705
+ rules: [
10706
+ {
10707
+ rules: module.defaultRules
10708
+ },
10709
+ {
10710
+ rules: module.rules
10711
+ }
10712
+ ].map((rule, index)=>getRawModuleRule(rule, `ruleSet[${index}]`, options1, "javascript/auto")),
10713
+ parser: Object.fromEntries(Object.entries(parser = module.parser).map(([k, v])=>[
10714
+ k,
10715
+ getRawParserOptions(v, k)
10716
+ ]).filter(([k, v])=>void 0 !== v)),
10717
+ generator: Object.fromEntries(Object.entries(generator = module.generator).map(([k, v])=>[
10718
+ k,
10719
+ getRawGeneratorOptions(v, k)
10720
+ ]).filter(([k, v])=>void 0 !== v)),
10721
+ noParse: module.noParse
10722
+ }),
10723
+ optimization: options.optimization,
10724
+ stats: {
10725
+ colors: function(options) {
10726
+ if ("boolean" == typeof options || "string" == typeof options) return presetToOptions(options);
10727
+ if (!options) return {};
10728
+ let obj = {
10729
+ ...presetToOptions(options.preset),
10730
+ ...options
10731
+ };
10732
+ return delete obj.preset, obj;
10733
+ }(stats = options.stats).colors ?? !1
10734
+ },
10735
+ cache: {
10736
+ type: options.cache ? "memory" : "disable"
10737
+ },
10738
+ experiments,
10739
+ node: function(node) {
10740
+ if (!1 !== node) return external_node_assert_default()(!isNil(node.__dirname) && !isNil(node.global) && !isNil(node.__filename)), {
10741
+ dirname: String(node.__dirname),
10742
+ filename: String(node.__filename),
10743
+ global: String(node.global)
10744
+ };
10745
+ }(options.node),
10746
+ profile: options.profile,
10747
+ amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
10748
+ bail: options.bail,
10749
+ __references: {}
10750
+ };
10751
+ })(options, this);
11363
10752
  rawOptions.__references = Object.fromEntries(this.#ruleSet.builtinReferences.entries());
11364
10753
  let instanceBinding = __webpack_require__("@rspack/binding");
11365
10754
  this.#registers = this.#createHooksRegisters();
@@ -11367,16 +10756,537 @@ Help:
11367
10756
  this.#instance = new instanceBinding.JsCompiler(this.compilerPath, rawOptions, this.#builtinPlugins, this.#registers, ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem), this.intermediateFileSystem ? ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem) : void 0, inputFileSystem, ResolverFactory.__to_binding(this.resolverFactory)), callback(null, this.#instance);
11368
10757
  }
11369
10758
  #createHooksRegisters() {
11370
- let ref = new WeakRef(this), getCompiler = ()=>ref.deref(), createTap = this.#createHookRegisterTaps.bind(this), createMapTap = this.#createHookMapRegisterTaps.bind(this);
10759
+ let getCompiler, createTap, getCompiler1, createTap1, createMapTap, getCompiler2, createTap2, createMapTap1, getCompiler3, createTap3, getCompiler4, getCompiler5, createTap4, getCompiler6, createTap5, ref = new WeakRef(this), getCompiler7 = ()=>ref.deref(), createTap6 = this.#createHookRegisterTaps.bind(this), createMapTap2 = this.#createHookMapRegisterTaps.bind(this);
11371
10760
  return {
11372
- ...createCompilerHooksRegisters(getCompiler, createTap, createMapTap),
11373
- ...createCompilationHooksRegisters(getCompiler, createTap, createMapTap),
11374
- ...createNormalModuleFactoryHooksRegisters(getCompiler, createTap, createMapTap),
11375
- ...createContextModuleFactoryHooksRegisters(getCompiler, createTap, createMapTap),
11376
- ...createJavaScriptModulesHooksRegisters(getCompiler, createTap, createMapTap),
11377
- ...createHtmlPluginHooksRegisters(getCompiler, createTap, createMapTap),
11378
- ...createRuntimePluginHooksRegisters(getCompiler, createTap, createMapTap),
11379
- ...createRsdoctorPluginHooksRegisters(getCompiler, createTap, createMapTap)
10761
+ ...(getCompiler = getCompiler7, {
10762
+ registerCompilerThisCompilationTaps: (createTap = createTap6)(binding_.RegisterJsTapKind.CompilerThisCompilation, function() {
10763
+ return getCompiler().hooks.thisCompilation;
10764
+ }, function(queried) {
10765
+ return function(native) {
10766
+ return getCompiler().__internal__create_compilation(native), queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10767
+ };
10768
+ }),
10769
+ registerCompilerCompilationTaps: createTap(binding_.RegisterJsTapKind.CompilerCompilation, function() {
10770
+ return getCompiler().hooks.compilation;
10771
+ }, function(queried) {
10772
+ return function() {
10773
+ return queried.call(getCompiler().__internal__get_compilation(), getCompiler().__internal__get_compilation_params());
10774
+ };
10775
+ }),
10776
+ registerCompilerMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerMake, function() {
10777
+ return getCompiler().hooks.make;
10778
+ }, function(queried) {
10779
+ return async function() {
10780
+ return await queried.promise(getCompiler().__internal__get_compilation());
10781
+ };
10782
+ }),
10783
+ registerCompilerFinishMakeTaps: createTap(binding_.RegisterJsTapKind.CompilerFinishMake, function() {
10784
+ return getCompiler().hooks.finishMake;
10785
+ }, function(queried) {
10786
+ return async function() {
10787
+ return await queried.promise(getCompiler().__internal__get_compilation());
10788
+ };
10789
+ }),
10790
+ registerCompilerShouldEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerShouldEmit, function() {
10791
+ return getCompiler().hooks.shouldEmit;
10792
+ }, function(queried) {
10793
+ return function() {
10794
+ return queried.call(getCompiler().__internal__get_compilation());
10795
+ };
10796
+ }),
10797
+ registerCompilerEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerEmit, function() {
10798
+ return getCompiler().hooks.emit;
10799
+ }, function(queried) {
10800
+ return async function() {
10801
+ return await queried.promise(getCompiler().__internal__get_compilation());
10802
+ };
10803
+ }),
10804
+ registerCompilerAfterEmitTaps: createTap(binding_.RegisterJsTapKind.CompilerAfterEmit, function() {
10805
+ return getCompiler().hooks.afterEmit;
10806
+ }, function(queried) {
10807
+ return async function() {
10808
+ return await queried.promise(getCompiler().__internal__get_compilation());
10809
+ };
10810
+ }),
10811
+ registerCompilerAssetEmittedTaps: createTap(binding_.RegisterJsTapKind.CompilerAssetEmitted, function() {
10812
+ return getCompiler().hooks.assetEmitted;
10813
+ }, function(queried) {
10814
+ return async function({ filename, targetPath, outputPath }) {
10815
+ return queried.promise(filename, {
10816
+ compilation: getCompiler().__internal__get_compilation(),
10817
+ targetPath,
10818
+ outputPath,
10819
+ get source () {
10820
+ return getCompiler().__internal__get_compilation().getAsset(filename)?.source;
10821
+ },
10822
+ get content () {
10823
+ return this.source?.buffer();
10824
+ }
10825
+ });
10826
+ };
10827
+ })
10828
+ }),
10829
+ ...(getCompiler1 = getCompiler7, createTap1 = createTap6, createMapTap = createMapTap2, {
10830
+ registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements, function() {
10831
+ return getCompiler1().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
10832
+ }, function(queried) {
10833
+ return function({ chunk, runtimeRequirements }) {
10834
+ let set = __from_binding_runtime_globals(runtimeRequirements);
10835
+ return queried.call(chunk, set), {
10836
+ runtimeRequirements: __to_binding_runtime_globals(set)
10837
+ };
10838
+ };
10839
+ }),
10840
+ registerCompilationRuntimeRequirementInTreeTaps: createMapTap(binding_.RegisterJsTapKind.CompilationRuntimeRequirementInTree, function() {
10841
+ return getCompiler1().__internal__get_compilation().hooks.runtimeRequirementInTree;
10842
+ }, function(queried) {
10843
+ return function({ chunk, allRuntimeRequirements, runtimeRequirements }) {
10844
+ let set = __from_binding_runtime_globals(runtimeRequirements), all = __from_binding_runtime_globals(allRuntimeRequirements), customRuntimeGlobals = new Set(), originalAdd = all.add.bind(all), add = function(r) {
10845
+ let r1;
10846
+ return all.has(r) ? all : (r1 = r, RESERVED_RUNTIME_GLOBALS.has(r1) || customRuntimeGlobals.add(r), originalAdd(r));
10847
+ };
10848
+ for (let r of (all.add = add.bind(add), set))queried.for(r).call(chunk, all);
10849
+ for (let r of customRuntimeGlobals)queried.for(r).call(chunk, all);
10850
+ return {
10851
+ allRuntimeRequirements: __to_binding_runtime_globals(all)
10852
+ };
10853
+ };
10854
+ }),
10855
+ registerCompilationRuntimeModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationRuntimeModule, function() {
10856
+ return getCompiler1().__internal__get_compilation().hooks.runtimeModule;
10857
+ }, function(queried) {
10858
+ return function({ module, chunk }) {
10859
+ let originSource = module.source?.source;
10860
+ queried.call(module, chunk);
10861
+ let newSource = module.source?.source;
10862
+ if (newSource && newSource !== originSource) return module;
10863
+ };
10864
+ }),
10865
+ registerCompilationBuildModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationBuildModule, function() {
10866
+ return getCompiler1().__internal__get_compilation().hooks.buildModule;
10867
+ }, function(queried) {
10868
+ return function(module) {
10869
+ return queried.call(module);
10870
+ };
10871
+ }),
10872
+ registerCompilationStillValidModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationStillValidModule, function() {
10873
+ return getCompiler1().__internal__get_compilation().hooks.stillValidModule;
10874
+ }, function(queried) {
10875
+ return function(module) {
10876
+ return queried.call(module);
10877
+ };
10878
+ }),
10879
+ registerCompilationSucceedModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationSucceedModule, function() {
10880
+ return getCompiler1().__internal__get_compilation().hooks.succeedModule;
10881
+ }, function(queried) {
10882
+ return function(module) {
10883
+ return queried.call(module);
10884
+ };
10885
+ }),
10886
+ registerCompilationExecuteModuleTaps: createTap1(binding_.RegisterJsTapKind.CompilationExecuteModule, function() {
10887
+ return getCompiler1().__internal__get_compilation().hooks.executeModule;
10888
+ }, function(queried) {
10889
+ return function({ entry, id, codegenResults, runtimeModules }) {
10890
+ try {
10891
+ let __nested_webpack_require_4786_4805__ = (id)=>{
10892
+ let cached = moduleCache[id];
10893
+ if (void 0 !== cached) {
10894
+ if (cached.error) throw cached.error;
10895
+ return cached.exports;
10896
+ }
10897
+ let execOptions = {
10898
+ id,
10899
+ module: {
10900
+ id,
10901
+ exports: {},
10902
+ loaded: !1,
10903
+ error: void 0
10904
+ },
10905
+ require: __nested_webpack_require_4786_4805__
10906
+ };
10907
+ for (let handler of interceptModuleExecution)handler(execOptions);
10908
+ let result = codegenResults.map[id]["build time"], moduleObject = execOptions.module;
10909
+ return id && (moduleCache[id] = moduleObject), ((fn, hook)=>{
10910
+ try {
10911
+ fn();
10912
+ } catch (err) {
10913
+ if (err instanceof WebpackError) throw err;
10914
+ throw new HookWebpackError(err, hook);
10915
+ }
10916
+ })(()=>queried.call({
10917
+ codeGenerationResult: new CodeGenerationResult(result),
10918
+ moduleObject
10919
+ }, {
10920
+ __webpack_require__: __nested_webpack_require_4786_4805__
10921
+ }), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
10922
+ }, moduleCache = __nested_webpack_require_4786_4805__[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = __nested_webpack_require_4786_4805__[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
10923
+ for (let runtimeModule of runtimeModules)__nested_webpack_require_4786_4805__(runtimeModule);
10924
+ let executeResult = __nested_webpack_require_4786_4805__(entry);
10925
+ getCompiler1().__internal__get_module_execution_results_map().set(id, executeResult);
10926
+ } catch (e) {
10927
+ throw getCompiler1().__internal__get_module_execution_results_map().set(id, e), e;
10928
+ }
10929
+ };
10930
+ }),
10931
+ registerCompilationFinishModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationFinishModules, function() {
10932
+ return getCompiler1().__internal__get_compilation().hooks.finishModules;
10933
+ }, function(queried) {
10934
+ return async function() {
10935
+ return await queried.promise(getCompiler1().__internal__get_compilation().modules);
10936
+ };
10937
+ }),
10938
+ registerCompilationOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeModules, function() {
10939
+ return getCompiler1().__internal__get_compilation().hooks.optimizeModules;
10940
+ }, function(queried) {
10941
+ return function() {
10942
+ return queried.call(getCompiler1().__internal__get_compilation().modules.values());
10943
+ };
10944
+ }),
10945
+ registerCompilationAfterOptimizeModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterOptimizeModules, function() {
10946
+ return getCompiler1().__internal__get_compilation().hooks.afterOptimizeModules;
10947
+ }, function(queried) {
10948
+ return function() {
10949
+ queried.call(getCompiler1().__internal__get_compilation().modules.values());
10950
+ };
10951
+ }),
10952
+ registerCompilationOptimizeTreeTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeTree, function() {
10953
+ return getCompiler1().__internal__get_compilation().hooks.optimizeTree;
10954
+ }, function(queried) {
10955
+ return async function() {
10956
+ return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
10957
+ };
10958
+ }),
10959
+ registerCompilationOptimizeChunkModulesTaps: createTap1(binding_.RegisterJsTapKind.CompilationOptimizeChunkModules, function() {
10960
+ return getCompiler1().__internal__get_compilation().hooks.optimizeChunkModules;
10961
+ }, function(queried) {
10962
+ return async function() {
10963
+ return await queried.promise(getCompiler1().__internal__get_compilation().chunks, getCompiler1().__internal__get_compilation().modules);
10964
+ };
10965
+ }),
10966
+ registerCompilationChunkHashTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkHash, function() {
10967
+ return getCompiler1().__internal__get_compilation().hooks.chunkHash;
10968
+ }, function(queried) {
10969
+ return function(chunk) {
10970
+ let digestResult;
10971
+ if (!getCompiler1().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
10972
+ let hash = createHash(getCompiler1().options.output.hashFunction);
10973
+ return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler1().options.output.hashDigest ? hash.digest(getCompiler1().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
10974
+ };
10975
+ }),
10976
+ registerCompilationChunkAssetTaps: createTap1(binding_.RegisterJsTapKind.CompilationChunkAsset, function() {
10977
+ return getCompiler1().__internal__get_compilation().hooks.chunkAsset;
10978
+ }, function(queried) {
10979
+ return function({ chunk, filename }) {
10980
+ return queried.call(chunk, filename);
10981
+ };
10982
+ }),
10983
+ registerCompilationProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationProcessAssets, function() {
10984
+ return getCompiler1().__internal__get_compilation().hooks.processAssets;
10985
+ }, function(queried) {
10986
+ return async function() {
10987
+ return await queried.promise(getCompiler1().__internal__get_compilation().assets);
10988
+ };
10989
+ }),
10990
+ registerCompilationAfterProcessAssetsTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterProcessAssets, function() {
10991
+ return getCompiler1().__internal__get_compilation().hooks.afterProcessAssets;
10992
+ }, function(queried) {
10993
+ return function() {
10994
+ return queried.call(getCompiler1().__internal__get_compilation().assets);
10995
+ };
10996
+ }),
10997
+ registerCompilationSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationSeal, function() {
10998
+ return getCompiler1().__internal__get_compilation().hooks.seal;
10999
+ }, function(queried) {
11000
+ return function() {
11001
+ return queried.call();
11002
+ };
11003
+ }),
11004
+ registerCompilationAfterSealTaps: createTap1(binding_.RegisterJsTapKind.CompilationAfterSeal, function() {
11005
+ return getCompiler1().__internal__get_compilation().hooks.afterSeal;
11006
+ }, function(queried) {
11007
+ return async function() {
11008
+ return await queried.promise();
11009
+ };
11010
+ })
11011
+ }),
11012
+ ...(getCompiler2 = getCompiler7, createTap2 = createTap6, createMapTap1 = createMapTap2, {
11013
+ registerNormalModuleFactoryBeforeResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryBeforeResolve, function() {
11014
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
11015
+ }, function(queried) {
11016
+ return async function(resolveData) {
11017
+ let normalizedResolveData = {
11018
+ contextInfo: {
11019
+ issuer: resolveData.issuer,
11020
+ issuerLayer: resolveData.issuerLayer ?? null
11021
+ },
11022
+ request: resolveData.request,
11023
+ context: resolveData.context,
11024
+ fileDependencies: [],
11025
+ missingDependencies: [],
11026
+ contextDependencies: []
11027
+ }, ret = await queried.promise(normalizedResolveData);
11028
+ return resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, [
11029
+ ret,
11030
+ resolveData
11031
+ ];
11032
+ };
11033
+ }),
11034
+ registerNormalModuleFactoryFactorizeTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryFactorize, function() {
11035
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
11036
+ }, function(queried) {
11037
+ return async function(resolveData) {
11038
+ let normalizedResolveData = {
11039
+ contextInfo: {
11040
+ issuer: resolveData.issuer,
11041
+ issuerLayer: resolveData.issuerLayer ?? null
11042
+ },
11043
+ request: resolveData.request,
11044
+ context: resolveData.context,
11045
+ fileDependencies: [],
11046
+ missingDependencies: [],
11047
+ contextDependencies: []
11048
+ };
11049
+ return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
11050
+ };
11051
+ }),
11052
+ registerNormalModuleFactoryResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryResolve, function() {
11053
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
11054
+ }, function(queried) {
11055
+ return async function(resolveData) {
11056
+ let normalizedResolveData = {
11057
+ contextInfo: {
11058
+ issuer: resolveData.issuer,
11059
+ issuerLayer: resolveData.issuerLayer ?? null
11060
+ },
11061
+ request: resolveData.request,
11062
+ context: resolveData.context,
11063
+ fileDependencies: [],
11064
+ missingDependencies: [],
11065
+ contextDependencies: []
11066
+ };
11067
+ return await queried.promise(normalizedResolveData), resolveData.request = normalizedResolveData.request, resolveData.context = normalizedResolveData.context, resolveData;
11068
+ };
11069
+ }),
11070
+ registerNormalModuleFactoryResolveForSchemeTaps: createMapTap1(binding_.RegisterJsTapKind.NormalModuleFactoryResolveForScheme, function() {
11071
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
11072
+ }, function(queried) {
11073
+ return async function(args) {
11074
+ return [
11075
+ await queried.for(args.scheme).promise(args.resourceData),
11076
+ args.resourceData
11077
+ ];
11078
+ };
11079
+ }),
11080
+ registerNormalModuleFactoryAfterResolveTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryAfterResolve, function() {
11081
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
11082
+ }, function(queried) {
11083
+ return async function(arg) {
11084
+ let data = {
11085
+ contextInfo: {
11086
+ issuer: arg.issuer,
11087
+ issuerLayer: arg.issuerLayer ?? null
11088
+ },
11089
+ request: arg.request,
11090
+ context: arg.context,
11091
+ fileDependencies: arg.fileDependencies,
11092
+ missingDependencies: arg.missingDependencies,
11093
+ contextDependencies: arg.contextDependencies,
11094
+ createData: arg.createData
11095
+ };
11096
+ return [
11097
+ await queried.promise(data),
11098
+ data.createData
11099
+ ];
11100
+ };
11101
+ }),
11102
+ registerNormalModuleFactoryCreateModuleTaps: createTap2(binding_.RegisterJsTapKind.NormalModuleFactoryCreateModule, function() {
11103
+ return getCompiler2().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
11104
+ }, function(queried) {
11105
+ return async function(args) {
11106
+ let data = {
11107
+ ...args,
11108
+ settings: {}
11109
+ };
11110
+ await queried.promise(data, {});
11111
+ };
11112
+ })
11113
+ }),
11114
+ ...(getCompiler3 = getCompiler7, {
11115
+ registerContextModuleFactoryBeforeResolveTaps: (createTap3 = createTap6)(binding_.RegisterJsTapKind.ContextModuleFactoryBeforeResolve, function() {
11116
+ return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
11117
+ }, function(queried) {
11118
+ return async function(bindingData) {
11119
+ let data = !!bindingData && ContextModuleFactoryBeforeResolveData.__from_binding(bindingData), result = await queried.promise(data);
11120
+ return !!result && ContextModuleFactoryBeforeResolveData.__to_binding(result);
11121
+ };
11122
+ }),
11123
+ registerContextModuleFactoryAfterResolveTaps: createTap3(binding_.RegisterJsTapKind.ContextModuleFactoryAfterResolve, function() {
11124
+ return getCompiler3().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
11125
+ }, function(queried) {
11126
+ return async function(bindingData) {
11127
+ let data = !!bindingData && ContextModuleFactoryAfterResolveData.__from_binding(bindingData), result = await queried.promise(data);
11128
+ return !!result && ContextModuleFactoryAfterResolveData.__to_binding(result);
11129
+ };
11130
+ })
11131
+ }),
11132
+ ...(getCompiler4 = getCompiler7, {
11133
+ registerJavascriptModulesChunkHashTaps: createTap6(binding_.RegisterJsTapKind.JavascriptModulesChunkHash, function() {
11134
+ return JavascriptModulesPlugin.getCompilationHooks(getCompiler4().__internal__get_compilation()).chunkHash;
11135
+ }, function(queried) {
11136
+ return function(chunk) {
11137
+ let digestResult;
11138
+ if (!getCompiler4().options.output.hashFunction) throw Error("'output.hashFunction' cannot be undefined");
11139
+ let hash = createHash(getCompiler4().options.output.hashFunction);
11140
+ return queried.call(chunk, hash), "string" == typeof (digestResult = getCompiler4().options.output.hashDigest ? hash.digest(getCompiler4().options.output.hashDigest) : hash.digest()) ? Buffer.from(digestResult) : digestResult;
11141
+ };
11142
+ })
11143
+ }),
11144
+ ...((getCompiler, createTap, createMapTap)=>{
11145
+ let getOptions = (uid)=>((compilation, uid)=>{
11146
+ if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
11147
+ return compilationOptionsMap.get(compilation)?.[uid];
11148
+ })(getCompiler().__internal__get_compilation(), uid);
11149
+ return {
11150
+ registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
11151
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
11152
+ }, function(queried) {
11153
+ return async function(data) {
11154
+ let { compilationId, uid } = data, res = await queried.promise({
11155
+ ...data,
11156
+ plugin: {
11157
+ options: getOptions(uid)
11158
+ }
11159
+ });
11160
+ return res.compilationId = compilationId, res.uid = uid, res;
11161
+ };
11162
+ }),
11163
+ registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
11164
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
11165
+ }, function(queried) {
11166
+ return async function(data) {
11167
+ let { compilationId, uid } = data, res = await queried.promise({
11168
+ ...data,
11169
+ plugin: {
11170
+ options: getOptions(uid)
11171
+ }
11172
+ });
11173
+ return res.compilationId = compilationId, res.uid = uid, res;
11174
+ };
11175
+ }),
11176
+ registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
11177
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
11178
+ }, function(queried) {
11179
+ return async function(data) {
11180
+ let { compilationId, uid } = data, res = await queried.promise({
11181
+ ...data,
11182
+ plugin: {
11183
+ options: getOptions(uid)
11184
+ }
11185
+ });
11186
+ return res.compilationId = compilationId, res.uid = uid, res;
11187
+ };
11188
+ }),
11189
+ registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
11190
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
11191
+ }, function(queried) {
11192
+ return async function(data) {
11193
+ let { compilationId, uid } = data, res = await queried.promise({
11194
+ ...data,
11195
+ plugin: {
11196
+ options: getOptions(uid)
11197
+ }
11198
+ });
11199
+ return res.compilationId = compilationId, res;
11200
+ };
11201
+ }),
11202
+ registerHtmlPluginBeforeEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeEmit, function() {
11203
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
11204
+ }, function(queried) {
11205
+ return async function(data) {
11206
+ let { compilationId, uid } = data, res = await queried.promise({
11207
+ ...data,
11208
+ plugin: {
11209
+ options: getOptions(uid)
11210
+ }
11211
+ });
11212
+ return res.compilationId = compilationId, res.uid = uid, res;
11213
+ };
11214
+ }),
11215
+ registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
11216
+ return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
11217
+ }, function(queried) {
11218
+ return async function(data) {
11219
+ let { compilationId, uid } = data, res = await queried.promise({
11220
+ ...data,
11221
+ plugin: {
11222
+ options: getOptions(uid)
11223
+ }
11224
+ });
11225
+ return res.compilationId = compilationId, res.uid = uid, res;
11226
+ };
11227
+ })
11228
+ };
11229
+ })(getCompiler7, createTap6, 0),
11230
+ ...(getCompiler5 = getCompiler7, {
11231
+ registerRuntimePluginCreateScriptTaps: (createTap4 = createTap6)(binding_.RegisterJsTapKind.RuntimePluginCreateScript, function() {
11232
+ return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).createScript;
11233
+ }, function(queried) {
11234
+ return function(data) {
11235
+ return queried.call(data.code, data.chunk);
11236
+ };
11237
+ }),
11238
+ registerRuntimePluginLinkPreloadTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPreload, function() {
11239
+ return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPreload;
11240
+ }, function(queried) {
11241
+ return function(data) {
11242
+ return queried.call(data.code, data.chunk);
11243
+ };
11244
+ }),
11245
+ registerRuntimePluginLinkPrefetchTaps: createTap4(binding_.RegisterJsTapKind.RuntimePluginLinkPrefetch, function() {
11246
+ return RuntimePlugin.getCompilationHooks(getCompiler5().__internal__get_compilation()).linkPrefetch;
11247
+ }, function(queried) {
11248
+ return function(data) {
11249
+ return queried.call(data.code, data.chunk);
11250
+ };
11251
+ })
11252
+ }),
11253
+ ...(getCompiler6 = getCompiler7, {
11254
+ registerRsdoctorPluginModuleGraphTaps: (createTap5 = createTap6)(binding_.RegisterJsTapKind.RsdoctorPluginModuleGraph, function() {
11255
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleGraph;
11256
+ }, function(queried) {
11257
+ return async function(data) {
11258
+ return await queried.promise(data);
11259
+ };
11260
+ }),
11261
+ registerRsdoctorPluginChunkGraphTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginChunkGraph, function() {
11262
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).chunkGraph;
11263
+ }, function(queried) {
11264
+ return async function(data) {
11265
+ return await queried.promise(data);
11266
+ };
11267
+ }),
11268
+ registerRsdoctorPluginModuleIdsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleIds, function() {
11269
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleIds;
11270
+ }, function(queried) {
11271
+ return async function(data) {
11272
+ return await queried.promise(data);
11273
+ };
11274
+ }),
11275
+ registerRsdoctorPluginModuleSourcesTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginModuleSources, function() {
11276
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).moduleSources;
11277
+ }, function(queried) {
11278
+ return async function(data) {
11279
+ return await queried.promise(data);
11280
+ };
11281
+ }),
11282
+ registerRsdoctorPluginAssetsTaps: createTap5(binding_.RegisterJsTapKind.RsdoctorPluginAssets, function() {
11283
+ return RsdoctorPluginImpl.getCompilationHooks(getCompiler6().__internal__get_compilation()).assets;
11284
+ }, function(queried) {
11285
+ return async function(data) {
11286
+ return await queried.promise(data);
11287
+ };
11288
+ })
11289
+ })
11380
11290
  };
11381
11291
  }
11382
11292
  #updateNonSkippableRegisters() {
@@ -11502,7 +11412,7 @@ Help:
11502
11412
  obj.children = this.stats.map((stat, idx)=>{
11503
11413
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
11504
11414
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
11505
- }), childOptions.version && (obj.rspackVersion = "1.4.7-alpha.0", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11415
+ }), childOptions.version && (obj.rspackVersion = "1.4.7-alpha.1", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
11506
11416
  let mapError = (j, obj)=>({
11507
11417
  ...obj,
11508
11418
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -11536,24 +11446,22 @@ Help:
11536
11446
  func = asyncLib_noop, fn(err);
11537
11447
  };
11538
11448
  }
11539
- let asyncLib = {
11540
- each: function(collection, iterator, originalCallback) {
11541
- let callback = once(originalCallback), size = 0, completed = 0;
11542
- if (Array.isArray(collection)) {
11543
- size = collection.length;
11544
- var array = collection, iterator1 = iterator, callback1 = (err)=>{
11545
- err ? (callback = once(callback))(err) : ++completed === size && callback(null);
11449
+ let asyncLib_each = function(collection, iterator, originalCallback) {
11450
+ let callback = once(originalCallback), size = 0, completed = 0;
11451
+ if (Array.isArray(collection)) {
11452
+ size = collection.length;
11453
+ var array = collection, iterator1 = iterator, callback1 = (err)=>{
11454
+ err ? (callback = once(callback))(err) : ++completed === size && callback(null);
11455
+ };
11456
+ let index = -1;
11457
+ for(; ++index < array.length;)iterator1(array[index], function(func) {
11458
+ return (err)=>{
11459
+ let fn = func;
11460
+ func = throwError, fn(err);
11546
11461
  };
11547
- let index = -1;
11548
- for(; ++index < array.length;)iterator1(array[index], function(func) {
11549
- return (err)=>{
11550
- let fn = func;
11551
- func = throwError, fn(err);
11552
- };
11553
- }(callback1));
11554
- }
11555
- size || callback(null);
11462
+ }(callback1));
11556
11463
  }
11464
+ size || callback(null);
11557
11465
  }, MultiWatching = class {
11558
11466
  watchings;
11559
11467
  compiler;
@@ -11561,15 +11469,15 @@ Help:
11561
11469
  this.watchings = watchings, this.compiler = compiler;
11562
11470
  }
11563
11471
  invalidate(callback) {
11564
- if (callback) asyncLib.each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
11472
+ if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidate(callback), callback);
11565
11473
  else for (let watching of this.watchings)watching.invalidate();
11566
11474
  }
11567
11475
  invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback) {
11568
- if (callback) asyncLib.each(this.watchings, (watching, callback)=>watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback), callback);
11476
+ if (callback) asyncLib_each(this.watchings, (watching, callback)=>watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles, callback), callback);
11569
11477
  else for (let watching of this.watchings)watching.invalidateWithChangesAndRemovals(changedFiles, removedFiles);
11570
11478
  }
11571
11479
  close(callback) {
11572
- asyncLib.each(this.watchings, (watching, finishedCallback)=>{
11480
+ asyncLib_each(this.watchings, (watching, finishedCallback)=>{
11573
11481
  watching.close(finishedCallback);
11574
11482
  }, (err)=>{
11575
11483
  this.compiler.hooks.watchClose.call(), "function" == typeof callback && (this.compiler.running = !1, callback(err));
@@ -11642,7 +11550,7 @@ Help:
11642
11550
  shutdown: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.shutdown)),
11643
11551
  infrastructureLog: new lite_tapable_namespaceObject.MultiHook(normalizedCompilers.map((c)=>c.hooks.infrastructureLog))
11644
11552
  }, this.compilers = normalizedCompilers, this._options = {
11645
- parallelism: options?.parallelism || Number.POSITIVE_INFINITY
11553
+ parallelism: options?.parallelism || 1 / 0
11646
11554
  }, this.dependencies = new WeakMap(), this.running = !1;
11647
11555
  let compilerStats = this.compilers.map(()=>null), doneCompilers = 0;
11648
11556
  for(let index = 0; index < this.compilers.length; index++){
@@ -11743,7 +11651,7 @@ Help:
11743
11651
  for (let node of nodes)0 === node.parents.length && (node.state = "queued", queue.enqueue(node));
11744
11652
  let errored = !1, running = 0, parallelism = this._options.parallelism, nodeDone = (node, err, stats)=>{
11745
11653
  if (!errored) {
11746
- if (err) return errored = !0, asyncLib.each(nodes, (node, callback)=>{
11654
+ if (err) return errored = !0, asyncLib_each(nodes, (node, callback)=>{
11747
11655
  node.compiler.watching ? node.compiler.watching.close(callback) : callback();
11748
11656
  }, ()=>callback(err));
11749
11657
  if (node.result = stats, running--, "running" === node.state) for (let child of (node.state = "done", node.children))"blocked" === child.state && queue.enqueue(child);
@@ -11754,11 +11662,12 @@ Help:
11754
11662
  for (let child of ("done" === node.state ? node.state = "blocked" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
11755
11663
  }, nodeInvalid = (node)=>{
11756
11664
  for (let child of ("done" === node.state ? node.state = "pending" : "running" === node.state && (node.state = "running-outdated"), node.children))nodeInvalidFromParent(child);
11757
- }, nodeChange = (node)=>{
11758
- nodeInvalid(node), "pending" === node.state && (node.state = "blocked"), "blocked" === node.state && (queue.enqueue(node), processQueue());
11759
11665
  }, setupResults = [];
11760
11666
  nodes.forEach((node, i)=>{
11761
- setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>nodeChange(node), ()=>nodeInvalid(node)));
11667
+ setupResults.push(node.setupResult = setup(node.compiler, i, nodeDone.bind(null, node), ()=>"starting" !== node.state && "running" !== node.state, ()=>{
11668
+ var node1;
11669
+ nodeInvalid(node1 = node), "pending" === node1.state && (node1.state = "blocked"), "blocked" === node1.state && (queue.enqueue(node1), processQueue());
11670
+ }, ()=>nodeInvalid(node)));
11762
11671
  });
11763
11672
  let processing = !0, processQueue = ()=>{
11764
11673
  processing || (processing = !0, process.nextTick(processQueueWorker));
@@ -11801,7 +11710,7 @@ Help:
11801
11710
  for (let compiler of this.compilers)compiler.inputFileSystem?.purge?.();
11802
11711
  }
11803
11712
  close(callback) {
11804
- asyncLib.each(this.compilers, (compiler, cb)=>{
11713
+ asyncLib_each(this.compilers, (compiler, cb)=>{
11805
11714
  compiler.close(cb);
11806
11715
  }, callback);
11807
11716
  }
@@ -11868,17 +11777,6 @@ Help:
11868
11777
  let count = 0;
11869
11778
  for (let child of children)child.children || child.filteredChildren ? (child.children && (count += getTotalItems(child.children)), child.filteredChildren && (count += child.filteredChildren)) : count++;
11870
11779
  return count;
11871
- }, collapse = (children)=>{
11872
- let newChildren = [];
11873
- for (let child of children)if (child.children) {
11874
- let filteredChildren = child.filteredChildren || 0;
11875
- filteredChildren += getTotalItems(child.children), newChildren.push({
11876
- ...child,
11877
- children: void 0,
11878
- filteredChildren
11879
- });
11880
- } else newChildren.push(child);
11881
- return newChildren;
11882
11780
  }, getTotalSize = (children)=>{
11883
11781
  let size = 0;
11884
11782
  for (let child of children)size += getItemSize(child);
@@ -11922,7 +11820,18 @@ Help:
11922
11820
  }
11923
11821
  }
11924
11822
  children = groups.concat(items);
11925
- } else limit === max ? (children = collapse(groups), filteredChildren = items.length) : filteredChildren = getTotalItems(itemsAndGroups);
11823
+ } else limit === max ? (children = ((children)=>{
11824
+ let newChildren = [];
11825
+ for (let child of children)if (child.children) {
11826
+ let filteredChildren = child.filteredChildren || 0;
11827
+ filteredChildren += getTotalItems(child.children), newChildren.push({
11828
+ ...child,
11829
+ children: void 0,
11830
+ filteredChildren
11831
+ });
11832
+ } else newChildren.push(child);
11833
+ return newChildren;
11834
+ })(groups), filteredChildren = items.length) : filteredChildren = getTotalItems(itemsAndGroups);
11926
11835
  }
11927
11836
  return {
11928
11837
  children,
@@ -11932,10 +11841,11 @@ Help:
11932
11841
  let count = getItems(compilation, "").length;
11933
11842
  for (let child of compilation.children)count += countWithChildren(child, (c, type)=>getItems(c, `.children[].compilation${type}`));
11934
11843
  return count;
11935
- }, normalizeFieldKey = (field)=>"!" === field[0] ? field.slice(1) : field, sortOrderRegular = (field)=>"!" !== field[0], sortByField = (field)=>{
11844
+ }, sortByField = (field)=>{
11845
+ var field1;
11936
11846
  if (!field) return (_a, _b)=>0;
11937
- let fieldKey = normalizeFieldKey(field), sortFn = compareSelect((m)=>m[fieldKey], compareIds);
11938
- if (!sortOrderRegular(field)) {
11847
+ let fieldKey = "!" === (field1 = field)[0] ? field1.slice(1) : field1, sortFn = compareSelect((m)=>m[fieldKey], compareIds);
11848
+ if ("!" === field[0]) {
11939
11849
  let oldSortFn = sortFn;
11940
11850
  sortFn = (a, b)=>oldSortFn(b, a);
11941
11851
  }
@@ -12402,7 +12312,7 @@ Help:
12402
12312
  object.hash = context.getStatsCompilation(compilation).hash;
12403
12313
  },
12404
12314
  version: (object)=>{
12405
- object.version = "5.75.0", object.rspackVersion = "1.4.7-alpha.0";
12315
+ object.version = "5.75.0", object.rspackVersion = "1.4.7-alpha.1";
12406
12316
  },
12407
12317
  env: (object, _compilation, _context, { _env })=>{
12408
12318
  object.env = _env;
@@ -12442,7 +12352,7 @@ Help:
12442
12352
  object.assetsByChunkName = assetsByChunkName.reduce((acc, cur)=>(acc[cur.name] = cur.files, acc), {});
12443
12353
  let limited = spaceLimited(factory.create(`${type}.assets`, Array.from(assets), {
12444
12354
  ...context
12445
- }), options.assetsSpace ?? Number.POSITIVE_INFINITY);
12355
+ }), options.assetsSpace ?? 1 / 0);
12446
12356
  object.assets = limited.children, object.filteredAssets = limited.filteredChildren;
12447
12357
  },
12448
12358
  chunks: (object, compilation, context, options, factory)=>{
@@ -12734,12 +12644,12 @@ Help:
12734
12644
  orphanModules: !0,
12735
12645
  runtimeModules: !0,
12736
12646
  excludeModules: !1,
12737
- errorsSpace: Number.POSITIVE_INFINITY,
12738
- warningsSpace: Number.POSITIVE_INFINITY,
12739
- modulesSpace: Number.POSITIVE_INFINITY,
12740
- chunkModulesSpace: Number.POSITIVE_INFINITY,
12741
- assetsSpace: Number.POSITIVE_INFINITY,
12742
- reasonsSpace: Number.POSITIVE_INFINITY,
12647
+ errorsSpace: 1 / 0,
12648
+ warningsSpace: 1 / 0,
12649
+ modulesSpace: 1 / 0,
12650
+ chunkModulesSpace: 1 / 0,
12651
+ assetsSpace: 1 / 0,
12652
+ reasonsSpace: 1 / 0,
12743
12653
  children: !0
12744
12654
  },
12745
12655
  detailed: {
@@ -12788,7 +12698,7 @@ Help:
12788
12698
  all: !1,
12789
12699
  errors: !0,
12790
12700
  errorsCount: !0,
12791
- errorsSpace: Number.POSITIVE_INFINITY,
12701
+ errorsSpace: 1 / 0,
12792
12702
  moduleTrace: !0,
12793
12703
  logging: "error"
12794
12704
  },
@@ -12796,10 +12706,10 @@ Help:
12796
12706
  all: !1,
12797
12707
  errors: !0,
12798
12708
  errorsCount: !0,
12799
- errorsSpace: Number.POSITIVE_INFINITY,
12709
+ errorsSpace: 1 / 0,
12800
12710
  warnings: !0,
12801
12711
  warningsCount: !0,
12802
- warningsSpace: Number.POSITIVE_INFINITY,
12712
+ warningsSpace: 1 / 0,
12803
12713
  logging: "warn"
12804
12714
  },
12805
12715
  summary: {
@@ -12823,7 +12733,7 @@ Help:
12823
12733
  chunkGroups: OFF_FOR_TO_STRING,
12824
12734
  chunkGroupAuxiliary: OFF_FOR_TO_STRING,
12825
12735
  chunkGroupChildren: OFF_FOR_TO_STRING,
12826
- chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 : Number.POSITIVE_INFINITY,
12736
+ chunkGroupMaxAssets: (o, { forToString })=>forToString ? 5 : 1 / 0,
12827
12737
  chunks: OFF_FOR_TO_STRING,
12828
12738
  chunkRelations: OFF_FOR_TO_STRING,
12829
12739
  chunkModules: ({ all, modules })=>!1 !== all && (!0 === all || !modules),
@@ -12838,16 +12748,16 @@ Help:
12838
12748
  groupModulesByAttributes: ON_FOR_TO_STRING,
12839
12749
  groupModulesByPath: ON_FOR_TO_STRING,
12840
12750
  groupModulesByExtension: ON_FOR_TO_STRING,
12841
- modulesSpace: (o, { forToString })=>forToString ? 15 : Number.POSITIVE_INFINITY,
12842
- chunkModulesSpace: (o, { forToString })=>forToString ? 10 : Number.POSITIVE_INFINITY,
12843
- nestedModulesSpace: (o, { forToString })=>forToString ? 10 : Number.POSITIVE_INFINITY,
12751
+ modulesSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
12752
+ chunkModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
12753
+ nestedModulesSpace: (o, { forToString })=>forToString ? 10 : 1 / 0,
12844
12754
  relatedAssets: OFF_FOR_TO_STRING,
12845
12755
  groupAssetsByEmitStatus: ON_FOR_TO_STRING,
12846
12756
  groupAssetsByInfo: ON_FOR_TO_STRING,
12847
12757
  groupAssetsByPath: ON_FOR_TO_STRING,
12848
12758
  groupAssetsByExtension: ON_FOR_TO_STRING,
12849
12759
  groupAssetsByChunk: ON_FOR_TO_STRING,
12850
- assetsSpace: (o, { forToString })=>forToString ? 15 : Number.POSITIVE_INFINITY,
12760
+ assetsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
12851
12761
  orphanModules: OFF_FOR_TO_STRING,
12852
12762
  runtimeModules: ({ all, runtime }, { forToString })=>void 0 !== runtime ? runtime : forToString ? !0 === all : !1 !== all,
12853
12763
  cachedModules: ({ all, cached }, { forToString })=>void 0 !== cached ? cached : forToString ? !0 === all : !1 !== all,
@@ -12855,7 +12765,7 @@ Help:
12855
12765
  depth: OFF_FOR_TO_STRING,
12856
12766
  cachedAssets: OFF_FOR_TO_STRING,
12857
12767
  reasons: OFF_FOR_TO_STRING,
12858
- reasonsSpace: (o, { forToString })=>forToString ? 15 : Number.POSITIVE_INFINITY,
12768
+ reasonsSpace: (o, { forToString })=>forToString ? 15 : 1 / 0,
12859
12769
  groupReasonsByOrigin: ON_FOR_TO_STRING,
12860
12770
  usedExports: OFF_FOR_TO_STRING,
12861
12771
  providedExports: OFF_FOR_TO_STRING,
@@ -12936,13 +12846,7 @@ Help:
12936
12846
  if (!dataUrl) return resource;
12937
12847
  let len = dataUrl[0].length + 16;
12938
12848
  return resource.length < len ? resource : `${resource.slice(0, Math.min(resource.length - 2, len))}..`;
12939
- }, getModuleName = (name)=>{
12940
- let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
12941
- return [
12942
- prefix,
12943
- getResourceName(resource)
12944
- ];
12945
- }, mapLines = (str, fn)=>str.split("\n").map(fn).join("\n"), twoDigit = (n)=>n >= 10 ? `${n}` : `0${n}`, isValidId = (id)=>"number" == typeof id || id, moreCount = (list, count)=>list && list.length > 0 ? `+ ${count}` : `${count}`, SIMPLE_PRINTERS = {
12849
+ }, mapLines = (str, fn)=>str.split("\n").map(fn).join("\n"), twoDigit = (n)=>n >= 10 ? `${n}` : `0${n}`, moreCount = (list, count)=>list && list.length > 0 ? `+ ${count}` : `${count}`, SIMPLE_PRINTERS = {
12946
12850
  "compilation.summary!": (_, { type, bold, green, red, yellow, formatDateTime, formatTime, compilation: { name, hash, rspackVersion, time, builtAt, errorsCount, warningsCount } })=>{
12947
12851
  let statusMessage, root = "compilation.summary!" === type, warningsMessage = warningsCount && warningsCount > 0 ? yellow(`${warningsCount} ${DefaultStatsPrinterPlugin_plural(warningsCount, "warning", "warnings")}`) : "", errorsMessage = errorsCount && errorsCount > 0 ? red(`${errorsCount} ${DefaultStatsPrinterPlugin_plural(errorsCount, "error", "errors")}`) : "", timeMessage = root && time ? ` in ${formatTime(time)}` : "", hashMessage = hash ? ` (${hash})` : "", builtAtMessage = root && builtAt ? `${formatDateTime(builtAt)}: ` : "", versionMessage = root && rspackVersion ? `Rspack ${rspackVersion}` : "", nameMessage = root && name ? bold(name) : name ? `Child ${bold(name)}` : root ? "" : "Child", subjectMessage = nameMessage && versionMessage ? `${nameMessage} (${versionMessage})` : versionMessage || nameMessage || "Rspack";
12948
12852
  if (statusMessage = errorsMessage && warningsMessage ? `compiled with ${errorsMessage} and ${warningsMessage}` : errorsMessage ? `compiled with ${errorsMessage}` : warningsMessage ? `compiled with ${warningsMessage}` : 0 === errorsCount && 0 === warningsCount ? `compiled ${green("successfully")}` : "compiled", builtAtMessage || versionMessage || errorsMessage || warningsMessage || 0 === errorsCount && 0 === warningsCount || timeMessage || hashMessage) return `${builtAtMessage}${subjectMessage} ${statusMessage}${timeMessage}${hashMessage}`;
@@ -13003,9 +12907,18 @@ Help:
13003
12907
  assetChunkName: (name)=>name,
13004
12908
  assetChunkIdHint: (name)=>name,
13005
12909
  "module.type": (type)=>"module" !== type ? type : void 0,
13006
- "module.id": (id, { formatModuleId })=>isValidId(id) ? formatModuleId(id) : void 0,
12910
+ "module.id": (id, { formatModuleId })=>{
12911
+ let id1;
12912
+ return "number" == typeof (id1 = id) || id1 ? formatModuleId(id) : void 0;
12913
+ },
13007
12914
  "module.name": (name, { bold })=>{
13008
- let [prefix, resource] = getModuleName(name);
12915
+ let [prefix, resource] = ((name)=>{
12916
+ let matchResourceMatch = /^([^!]+)!=!/.exec(name), n = matchResourceMatch ? matchResourceMatch[0] + getResourceName(name.slice(matchResourceMatch[0].length)) : name, [, prefix, resource] = /^(.*!)?([^!]*)$/.exec(n) || [];
12917
+ return [
12918
+ prefix,
12919
+ getResourceName(resource)
12920
+ ];
12921
+ })(name);
13009
12922
  return `${prefix || ""}${bold(resource || "")}`;
13010
12923
  },
13011
12924
  "module.identifier": (identifier)=>void 0,
@@ -13050,7 +12963,10 @@ Help:
13050
12963
  "moduleIssuer.profile.total": (value, { formatTime })=>formatTime(value),
13051
12964
  "moduleReason.type": (type)=>type,
13052
12965
  "moduleReason.userRequest": (userRequest, { cyan })=>cyan(getResourceName(userRequest)),
13053
- "moduleReason.moduleId": (moduleId, { formatModuleId })=>isValidId(moduleId) ? formatModuleId(moduleId) : void 0,
12966
+ "moduleReason.moduleId": (moduleId, { formatModuleId })=>{
12967
+ let id;
12968
+ return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
12969
+ },
13054
12970
  "moduleReason.module": (module, { magenta })=>magenta(module),
13055
12971
  "moduleReason.loc": (loc)=>loc,
13056
12972
  "moduleReason.explanation": (explanation, { cyan })=>cyan(explanation),
@@ -13102,7 +13018,10 @@ Help:
13102
13018
  return items.sort((a, b)=>compareIds(a.type, b.type)), Array.isArray(childrenByOrder) ? void 0 : printer.print(context.type, items, context);
13103
13019
  },
13104
13020
  "chunk.childrenByOrder[].type": (type)=>`${type}:`,
13105
- "chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>isValidId(id) ? formatChunkId(id) : void 0,
13021
+ "chunk.childrenByOrder[].children[]": (id, { formatChunkId })=>{
13022
+ let id1;
13023
+ return "number" == typeof (id1 = id) || id1 ? formatChunkId(id) : void 0;
13024
+ },
13106
13025
  "chunk.entry": (entry, { formatFlag, yellow })=>entry ? yellow(formatFlag("entry")) : void 0,
13107
13026
  "chunk.initial": (initial, { formatFlag, yellow })=>initial ? yellow(formatFlag("initial")) : void 0,
13108
13027
  "chunk.rendered": (rendered, { formatFlag, green })=>rendered ? green(formatFlag("rendered")) : void 0,
@@ -13111,7 +13030,10 @@ Help:
13111
13030
  "chunk.filteredModules": (filteredModules, { chunk: { modules } })=>filteredModules > 0 ? `${moreCount(modules, filteredModules)} chunk ${DefaultStatsPrinterPlugin_plural(filteredModules, "module", "modules")}` : void 0,
13112
13031
  "chunk.separator!": ()=>"\n",
13113
13032
  "chunkOrigin.request": (request)=>request,
13114
- "chunkOrigin.moduleId": (moduleId, { formatModuleId })=>isValidId(moduleId) ? formatModuleId(moduleId) : void 0,
13033
+ "chunkOrigin.moduleId": (moduleId, { formatModuleId })=>{
13034
+ let id;
13035
+ return "number" == typeof (id = moduleId) || id ? formatModuleId(moduleId) : void 0;
13036
+ },
13115
13037
  "chunkOrigin.moduleName": (moduleName, { bold })=>bold(moduleName),
13116
13038
  "chunkOrigin.loc": (loc)=>loc,
13117
13039
  "error.file": (file, { bold })=>bold(file),
@@ -13988,7 +13910,7 @@ Help:
13988
13910
  });
13989
13911
  }
13990
13912
  }
13991
- var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.1/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
13913
+ var CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.2/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js"), CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
13992
13914
  let filterToFunction = (item)=>{
13993
13915
  if ("string" == typeof item) {
13994
13916
  let regExp = RegExp(`[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)`);
@@ -14004,82 +13926,6 @@ Help:
14004
13926
  log: 2,
14005
13927
  true: 2,
14006
13928
  verbose: 1
14007
- }, createConsoleLogger = ({ level = "info", debug = !1, console: console1 })=>{
14008
- let debugFilters = "boolean" == typeof debug ? [
14009
- ()=>debug
14010
- ] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
14011
- return (name, type, args)=>{
14012
- let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
14013
- `[${name}] ${args[0]}`,
14014
- ...args.slice(1)
14015
- ] : [
14016
- `[${name}]`,
14017
- ...args
14018
- ] : [], debug = debugFilters.some((f)=>f(name));
14019
- switch(type){
14020
- case LogType.debug:
14021
- if (!debug) return;
14022
- "function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
14023
- break;
14024
- case LogType.log:
14025
- if (!debug && loglevel > LogLevel.log) return;
14026
- console1.log(...labeledArgs());
14027
- break;
14028
- case LogType.info:
14029
- if (!debug && loglevel > LogLevel.info) return;
14030
- console1.info(...labeledArgs());
14031
- break;
14032
- case LogType.warn:
14033
- if (!debug && loglevel > LogLevel.warn) return;
14034
- console1.warn(...labeledArgs());
14035
- break;
14036
- case LogType.error:
14037
- if (!debug && loglevel > LogLevel.error) return;
14038
- console1.error(...labeledArgs());
14039
- break;
14040
- case LogType.trace:
14041
- if (!debug) return;
14042
- console1.trace();
14043
- break;
14044
- case LogType.groupCollapsed:
14045
- if (!debug && loglevel > LogLevel.log) return;
14046
- if (!debug && loglevel > LogLevel.verbose) {
14047
- "function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
14048
- break;
14049
- }
14050
- case LogType.group:
14051
- if (!debug && loglevel > LogLevel.log) return;
14052
- "function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
14053
- break;
14054
- case LogType.groupEnd:
14055
- if (!debug && loglevel > LogLevel.log) return;
14056
- "function" == typeof console1.groupEnd && console1.groupEnd();
14057
- break;
14058
- case LogType.time:
14059
- {
14060
- if (!debug && loglevel > LogLevel.log) return;
14061
- let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
14062
- "function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
14063
- break;
14064
- }
14065
- case LogType.profile:
14066
- "function" == typeof console1.profile && console1.profile(...labeledArgs());
14067
- break;
14068
- case LogType.profileEnd:
14069
- "function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
14070
- break;
14071
- case LogType.clear:
14072
- if (!debug && loglevel > LogLevel.log) return;
14073
- "function" == typeof console1.clear && console1.clear();
14074
- break;
14075
- case LogType.status:
14076
- if (!debug && loglevel > LogLevel.info) return;
14077
- "function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
14078
- break;
14079
- default:
14080
- throw Error(`Unexpected LogType ${type}`);
14081
- }
14082
- };
14083
13929
  };
14084
13930
  class NodeWatchFileSystem {
14085
13931
  inputFileSystem;
@@ -14196,15 +14042,87 @@ Help:
14196
14042
  }
14197
14043
  apply(compiler) {
14198
14044
  let { infrastructureLogging } = this.options;
14199
- compiler.infrastructureLogger = createConsoleLogger({
14045
+ compiler.infrastructureLogger = (({ level = "info", debug = !1, console: console1 })=>{
14046
+ let debugFilters = "boolean" == typeof debug ? [
14047
+ ()=>debug
14048
+ ] : [].concat(debug).map(filterToFunction), loglevel = LogLevel[`${level}`] || 0;
14049
+ return (name, type, args)=>{
14050
+ let labeledArgs = ()=>Array.isArray(args) ? args.length > 0 && "string" == typeof args[0] ? [
14051
+ `[${name}] ${args[0]}`,
14052
+ ...args.slice(1)
14053
+ ] : [
14054
+ `[${name}]`,
14055
+ ...args
14056
+ ] : [], debug = debugFilters.some((f)=>f(name));
14057
+ switch(type){
14058
+ case LogType.debug:
14059
+ if (!debug) return;
14060
+ "function" == typeof console1.debug ? console1.debug(...labeledArgs()) : console1.log(...labeledArgs());
14061
+ break;
14062
+ case LogType.log:
14063
+ if (!debug && loglevel > LogLevel.log) return;
14064
+ console1.log(...labeledArgs());
14065
+ break;
14066
+ case LogType.info:
14067
+ if (!debug && loglevel > LogLevel.info) return;
14068
+ console1.info(...labeledArgs());
14069
+ break;
14070
+ case LogType.warn:
14071
+ if (!debug && loglevel > LogLevel.warn) return;
14072
+ console1.warn(...labeledArgs());
14073
+ break;
14074
+ case LogType.error:
14075
+ if (!debug && loglevel > LogLevel.error) return;
14076
+ console1.error(...labeledArgs());
14077
+ break;
14078
+ case LogType.trace:
14079
+ if (!debug) return;
14080
+ console1.trace();
14081
+ break;
14082
+ case LogType.groupCollapsed:
14083
+ if (!debug && loglevel > LogLevel.log) return;
14084
+ if (!debug && loglevel > LogLevel.verbose) {
14085
+ "function" == typeof console1.groupCollapsed ? console1.groupCollapsed(...labeledArgs()) : console1.log(...labeledArgs());
14086
+ break;
14087
+ }
14088
+ case LogType.group:
14089
+ if (!debug && loglevel > LogLevel.log) return;
14090
+ "function" == typeof console1.group ? console1.group(...labeledArgs()) : console1.log(...labeledArgs());
14091
+ break;
14092
+ case LogType.groupEnd:
14093
+ if (!debug && loglevel > LogLevel.log) return;
14094
+ "function" == typeof console1.groupEnd && console1.groupEnd();
14095
+ break;
14096
+ case LogType.time:
14097
+ {
14098
+ if (!debug && loglevel > LogLevel.log) return;
14099
+ let ms = 1000 * args[1] + args[2] / 1000000, msg = `[${name}] ${args[0]}: ${ms} ms`;
14100
+ "function" == typeof console1.logTime ? console1.logTime(msg) : console1.log(msg);
14101
+ break;
14102
+ }
14103
+ case LogType.profile:
14104
+ "function" == typeof console1.profile && console1.profile(...labeledArgs());
14105
+ break;
14106
+ case LogType.profileEnd:
14107
+ "function" == typeof console1.profileEnd && console1.profileEnd(...labeledArgs());
14108
+ break;
14109
+ case LogType.clear:
14110
+ if (!debug && loglevel > LogLevel.log) return;
14111
+ "function" == typeof console1.clear && console1.clear();
14112
+ break;
14113
+ case LogType.status:
14114
+ if (!debug && loglevel > LogLevel.info) return;
14115
+ "function" == typeof console1.status ? 0 === args.length ? console1.status() : console1.status(...labeledArgs()) : 0 !== args.length && console1.info(...labeledArgs());
14116
+ break;
14117
+ default:
14118
+ throw Error(`Unexpected LogType ${type}`);
14119
+ }
14120
+ };
14121
+ })({
14200
14122
  level: infrastructureLogging.level || "info",
14201
14123
  debug: infrastructureLogging.debug || !1,
14202
14124
  console: infrastructureLogging.console || function({ colors, appendOnly, stream }) {
14203
- let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0, indent = (str, prefix, colorPrefix, colorSuffix)=>{
14204
- if ("" === str) return str;
14205
- let prefixWithIndent = currentIndent + prefix;
14206
- return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
14207
- }, clearStatusMessage = ()=>{
14125
+ let currentStatusMessage, hasStatusMessage = !1, currentIndent = "", currentCollapsed = 0, clearStatusMessage = ()=>{
14208
14126
  hasStatusMessage && (stream.write("\x1b[2K\r"), hasStatusMessage = !1);
14209
14127
  }, writeStatusMessage = ()=>{
14210
14128
  if (!currentStatusMessage) return;
@@ -14213,7 +14131,11 @@ Help:
14213
14131
  }, writeColored = (prefix, colorPrefix, colorSuffix)=>(...args)=>{
14214
14132
  if (currentCollapsed > 0) return;
14215
14133
  clearStatusMessage();
14216
- let str = indent(external_node_util_namespaceObject.format(...args), prefix, colorPrefix, colorSuffix);
14134
+ let str = ((str, prefix, colorPrefix, colorSuffix)=>{
14135
+ if ("" === str) return str;
14136
+ let prefixWithIndent = currentIndent + prefix;
14137
+ return colors ? prefixWithIndent + colorPrefix + str.replace(/\n/g, `${colorSuffix}\n${prefix}${colorPrefix}`) + colorSuffix : prefixWithIndent + str.replace(/\n/g, `\n${prefix}`);
14138
+ })(external_node_util_namespaceObject.format(...args), prefix, colorPrefix, colorSuffix);
14217
14139
  stream.write(`${str}\n`), writeStatusMessage();
14218
14140
  }, writeGroupMessage = writeColored("<-> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m"), writeGroupCollapsedMessage = writeColored("<+> ", "\u001b[1m\u001b[36m", "\u001b[39m\u001b[22m");
14219
14141
  return {
@@ -14649,7 +14571,6 @@ Help:
14649
14571
  "node-commonjs",
14650
14572
  "commonjs-import"
14651
14573
  ])), getRspackOptionsSchema = memoize(()=>{
14652
- var params;
14653
14574
  let filenameTemplate = schemas_string(), filename = filenameTemplate.or(anyFunction), name = schemas_string(), dependencies = schemas_array(name), context = schemas_string().refine((val)=>external_node_path_default().isAbsolute(val), {
14654
14575
  error: (issue)=>`The provided value ${JSON.stringify(issue.input)} must be an absolute path`
14655
14576
  }), mode = schemas_enum([
@@ -15218,7 +15139,7 @@ Help:
15218
15139
  ]).or(_instanceof(RegExp)).or(anyFunction), optimizationSplitChunksSizes = numberOrInfinity.or(record(schemas_string(), numberOrInfinity)), sharedOptimizationSplitChunksCacheGroup = {
15219
15140
  chunks: optimizationSplitChunksChunks,
15220
15141
  defaultSizeTypes: schemas_array(schemas_string()),
15221
- minChunks: schemas_number().min(1).or(literal(Number.POSITIVE_INFINITY)),
15142
+ minChunks: schemas_number().min(1).or(literal(1 / 0)),
15222
15143
  usedExports: schemas_boolean(),
15223
15144
  name: optimizationSplitChunksName,
15224
15145
  filename: filename,
@@ -15433,7 +15354,7 @@ Help:
15433
15354
  bail: bail,
15434
15355
  performance: performance
15435
15356
  }).partial().check((ctx)=>{
15436
- let isLibraryUmd = !1, config = ctx.value, library = config?.output?.library;
15357
+ let config = ctx.value, library = config?.output?.library;
15437
15358
  function checkExternalItem(externalItem, path) {
15438
15359
  if ("object" == typeof externalItem && null !== externalItem) for (let [key, value] of Object.entries(externalItem)){
15439
15360
  var externalItemValue, path1;
@@ -15455,25 +15376,25 @@ Help:
15455
15376
  "externals"
15456
15377
  ]));
15457
15378
  });
15458
- }), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}), options_process = (options, normalizeSimple, normalizeOptions, fn)=>{
15459
- let object = (obj)=>{
15460
- for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple(value, key)) : fn(key, normalizeOptions(value, key));
15461
- };
15462
- if (options) if (Array.isArray(options)) {
15463
- var items = options;
15464
- for (let item of items)if ("string" == typeof item) fn(item, normalizeSimple(item, item));
15465
- else if (item && "object" == typeof item) object(item);
15466
- else throw Error("Unexpected options format");
15467
- } else if ("object" == typeof options) object(options);
15468
- else throw Error("Unexpected options format");
15469
- }, parseOptions = (options, normalizeSimple, normalizeOptions)=>{
15379
+ }), ModuleFederationRuntimePlugin = base_create(binding_.BuiltinPluginName.ModuleFederationRuntimePlugin, ()=>{}), parseOptions = (options, normalizeSimple, normalizeOptions)=>{
15470
15380
  let items = [];
15471
- return options_process(options, normalizeSimple, normalizeOptions, (key, value)=>{
15381
+ var options1 = options, normalizeSimple1 = normalizeSimple, normalizeOptions1 = normalizeOptions, fn = (key, value)=>{
15472
15382
  items.push([
15473
15383
  key,
15474
15384
  value
15475
15385
  ]);
15476
- }), items;
15386
+ };
15387
+ let object = (obj)=>{
15388
+ for (let [key, value] of Object.entries(obj))"string" == typeof value || Array.isArray(value) ? fn(key, normalizeSimple1(value, key)) : fn(key, normalizeOptions1(value, key));
15389
+ };
15390
+ if (options1) if (Array.isArray(options1)) {
15391
+ var items1 = options1;
15392
+ for (let item of items1)if ("string" == typeof item) fn(item, normalizeSimple1(item, item));
15393
+ else if (item && "object" == typeof item) object(item);
15394
+ else throw Error("Unexpected options format");
15395
+ } else if ("object" == typeof options1) object(options1);
15396
+ else throw Error("Unexpected options format");
15397
+ return items;
15477
15398
  };
15478
15399
  class ModuleFederationPlugin {
15479
15400
  _options;
@@ -15584,9 +15505,9 @@ Help:
15584
15505
  let compilerSet = new WeakSet();
15585
15506
  class ShareRuntimePlugin extends RspackBuiltinPlugin {
15586
15507
  enhanced;
15587
- name;
15508
+ name = binding_.BuiltinPluginName.ShareRuntimePlugin;
15588
15509
  constructor(enhanced = !1){
15589
- super(), this.enhanced = enhanced, this.name = binding_.BuiltinPluginName.ShareRuntimePlugin;
15510
+ super(), this.enhanced = enhanced;
15590
15511
  }
15591
15512
  raw(compiler) {
15592
15513
  var compiler1, compiler2;
@@ -15825,7 +15746,7 @@ Help:
15825
15746
  let _options = JSON.stringify(options || {});
15826
15747
  return binding_default().transform(source, _options);
15827
15748
  }
15828
- let exports_rspackVersion = "1.4.7-alpha.0", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15749
+ let exports_rspackVersion = "1.4.7-alpha.1", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
15829
15750
  getNormalizedRspackOptions: getNormalizedRspackOptions,
15830
15751
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
15831
15752
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -15964,12 +15885,13 @@ Help:
15964
15885
  }
15965
15886
  };
15966
15887
  function createCompiler(userOptions) {
15967
- let options = getNormalizedRspackOptions(userOptions);
15968
- applyRspackOptionsBaseDefaults(options), external_node_assert_default()(!isNil(options.context));
15969
- let compiler = new Compiler(options.context, options);
15888
+ var options;
15889
+ let options1 = getNormalizedRspackOptions(userOptions);
15890
+ defaults_F(options = options1, "context", ()=>process.cwd()), applyInfrastructureLoggingDefaults(options.infrastructureLogging), external_node_assert_default()(!isNil(options1.context));
15891
+ let compiler = new Compiler(options1.context, options1);
15970
15892
  if (new NodeEnvironmentPlugin({
15971
- infrastructureLogging: options.infrastructureLogging
15972
- }).apply(compiler), Array.isArray(options.plugins)) for (let plugin of options.plugins)"function" == typeof plugin ? plugin.call(compiler, compiler) : plugin && plugin.apply(compiler);
15893
+ infrastructureLogging: options1.infrastructureLogging
15894
+ }).apply(compiler), Array.isArray(options1.plugins)) for (let plugin of options1.plugins)"function" == typeof plugin ? plugin.call(compiler, compiler) : plugin && plugin.apply(compiler);
15973
15895
  return applyRspackOptionsDefaults(compiler.options), compiler.hooks.environment.call(), compiler.hooks.afterEnvironment.call(), new RspackOptionsApply().process(compiler.options, compiler), compiler.hooks.initialize.call(), compiler;
15974
15896
  }
15975
15897
  let src_fn = Object.assign(function(options, callback) {