@module-federation/bridge-vue3 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as Ft from "vue";
2
- import { defineComponent as Ht, ref as ge, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Vt, createVNode as Bt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
2
+ import { defineComponent as Ht, ref as ge, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Bt, createVNode as Vt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
3
3
  import * as ae from "vue-router";
4
4
  import { useRoute as Ke } from "vue-router";
5
5
  const Kt = ".json", zt = "FEDERATION_DEBUG", Jt = ":";
@@ -58,31 +58,31 @@ function Zt(e) {
58
58
  return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
59
59
  }
60
60
  function Qt(e, t = {}) {
61
- var E, b, N;
61
+ var E, b, S;
62
62
  const { remotes: r = {}, overrides: n = {}, version: o } = t;
63
63
  let s;
64
64
  const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && o ? Zt(o) : e.metaData.publicPath : e.metaData.getPublicPath, a = Object.keys(n);
65
65
  let l = {};
66
- Object.keys(r).length || (l = ((E = e.remotes) == null ? void 0 : E.reduce((_, $) => {
66
+ Object.keys(r).length || (l = ((E = e.remotes) == null ? void 0 : E.reduce((_, w) => {
67
67
  let R;
68
- const w = $.federationContainerName;
69
- return a.includes(w) ? R = n[w] : "version" in $ ? R = $.version : R = $.entry, _[w] = { matchedVersion: R }, _;
68
+ const N = w.federationContainerName;
69
+ return a.includes(N) ? R = n[N] : "version" in w ? R = w.version : R = w.entry, _[N] = { matchedVersion: R }, _;
70
70
  }, {})) || {}), Object.keys(r).forEach((_) => l[_] = { matchedVersion: a.includes(_) ? n[_] : r[_] });
71
- const { remoteEntry: { path: c, name: f, type: h }, types: u = {
71
+ const { remoteEntry: { path: c, name: u, type: d }, types: h = {
72
72
  path: "",
73
73
  name: "",
74
74
  zip: "",
75
75
  api: ""
76
- }, buildInfo: { buildVersion: d }, globalName: m, ssrRemoteEntry: y } = e.metaData, { exposes: g } = e;
77
- let p = {
76
+ }, buildInfo: { buildVersion: f }, globalName: p, ssrRemoteEntry: m } = e.metaData, { exposes: g } = e;
77
+ let y = {
78
78
  version: o || "",
79
- buildVersion: d,
80
- globalName: m,
81
- remoteEntry: ne(c, f),
82
- remoteEntryType: h,
83
- remoteTypes: ne(u.path, u.name),
84
- remoteTypesZip: u.zip || "",
85
- remoteTypesAPI: u.api || "",
79
+ buildVersion: f,
80
+ globalName: p,
81
+ remoteEntry: ne(c, u),
82
+ remoteEntryType: d,
83
+ remoteTypes: ne(h.path, h.name),
84
+ remoteTypesZip: h.zip || "",
85
+ remoteTypesAPI: h.api || "",
86
86
  remotesInfo: l,
87
87
  shared: e == null ? void 0 : e.shared.map((_) => ({
88
88
  assets: _.assets,
@@ -98,28 +98,28 @@ function Qt(e, t = {}) {
98
98
  };
99
99
  if ((b = e.metaData) != null && b.prefetchInterface) {
100
100
  const _ = e.metaData.prefetchInterface;
101
- p = {
102
- ...p,
101
+ y = {
102
+ ...y,
103
103
  prefetchInterface: _
104
104
  };
105
105
  }
106
- if ((N = e.metaData) != null && N.prefetchEntry) {
107
- const { path: _, name: $, type: R } = e.metaData.prefetchEntry;
108
- p = {
109
- ...p,
110
- prefetchEntry: ne(_, $),
106
+ if ((S = e.metaData) != null && S.prefetchEntry) {
107
+ const { path: _, name: w, type: R } = e.metaData.prefetchEntry;
108
+ y = {
109
+ ...y,
110
+ prefetchEntry: ne(_, w),
111
111
  prefetchEntryType: R
112
112
  };
113
113
  }
114
114
  if ("publicPath" in e.metaData ? (s = {
115
- ...p,
115
+ ...y,
116
116
  publicPath: i()
117
117
  }, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
118
- ...p,
118
+ ...y,
119
119
  getPublicPath: i()
120
- }, y) {
121
- const _ = ne(y.path, y.name);
122
- s.ssrRemoteEntry = _, s.ssrRemoteEntryType = y.type || "commonjs-module";
120
+ }, m) {
121
+ const _ = ne(m.path, m.name);
122
+ s.ssrRemoteEntry = _, s.ssrRemoteEntryType = m.type || "commonjs-module";
123
123
  }
124
124
  return s;
125
125
  }
@@ -248,48 +248,48 @@ function nt(e) {
248
248
  let t = null, r = !0, n = 2e4, o;
249
249
  const s = document.getElementsByTagName("script");
250
250
  for (let c = 0; c < s.length; c++) {
251
- const f = s[c], h = f.getAttribute("src");
252
- if (h && Ie(h, e.url)) {
253
- t = f, r = !1;
251
+ const u = s[c], d = u.getAttribute("src");
252
+ if (d && Ie(d, e.url)) {
253
+ t = u, r = !1;
254
254
  break;
255
255
  }
256
256
  }
257
257
  if (!t) {
258
258
  const c = e.attrs;
259
259
  t = document.createElement("script"), t.type = (c == null ? void 0 : c.type) === "module" ? "module" : "text/javascript";
260
- let f;
261
- e.createScriptHook && (f = e.createScriptHook(e.url, e.attrs), f instanceof HTMLScriptElement ? t = f : typeof f == "object" && ("script" in f && f.script && (t = f.script), "timeout" in f && f.timeout && (n = f.timeout))), t.src || (t.src = e.url), c && !f && Object.keys(c).forEach((h) => {
262
- t && (h === "async" || h === "defer" ? t[h] = c[h] : t.getAttribute(h) || t.setAttribute(h, c[h]));
260
+ let u;
261
+ e.createScriptHook && (u = e.createScriptHook(e.url, e.attrs), u instanceof HTMLScriptElement ? t = u : typeof u == "object" && ("script" in u && u.script && (t = u.script), "timeout" in u && u.timeout && (n = u.timeout))), t.src || (t.src = e.url), c && !u && Object.keys(c).forEach((d) => {
262
+ t && (d === "async" || d === "defer" ? t[d] = c[d] : t.getAttribute(d) || t.setAttribute(d, c[d]));
263
263
  });
264
264
  }
265
265
  let i = null;
266
266
  const a = typeof window < "u" ? (c) => {
267
267
  if (c.filename && Ie(c.filename, e.url)) {
268
- const f = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);
269
- f.name = "ScriptExecutionError", i = f;
268
+ const u = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);
269
+ u.name = "ScriptExecutionError", i = u;
270
270
  }
271
271
  } : null;
272
272
  a && window.addEventListener("error", a);
273
- const l = async (c, f) => {
273
+ const l = async (c, u) => {
274
274
  clearTimeout(o), a && window.removeEventListener("error", a);
275
- const h = () => {
276
- if ((f == null ? void 0 : f.type) === "error") {
277
- const u = /* @__PURE__ */ new Error(f != null && f.isTimeout ? `ScriptNetworkError: Script "${e.url}" timed out.` : `ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
278
- u.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
275
+ const d = () => {
276
+ if ((u == null ? void 0 : u.type) === "error") {
277
+ const h = /* @__PURE__ */ new Error(u != null && u.isTimeout ? `ScriptNetworkError: Script "${e.url}" timed out.` : `ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
278
+ h.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(h));
279
279
  } else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
280
280
  };
281
281
  if (t && (t.onerror = null, t.onload = null, rt(() => {
282
- const { needDeleteScript: u = !0 } = e;
283
- u && t != null && t.parentNode && t.parentNode.removeChild(t);
282
+ const { needDeleteScript: h = !0 } = e;
283
+ h && t != null && t.parentNode && t.parentNode.removeChild(t);
284
284
  }), c && typeof c == "function")) {
285
- const u = c(f);
286
- if (u instanceof Promise) {
287
- const d = await u;
288
- return h(), d;
285
+ const h = c(u);
286
+ if (h instanceof Promise) {
287
+ const f = await h;
288
+ return d(), f;
289
289
  }
290
- return h(), u;
290
+ return d(), h;
291
291
  }
292
- h();
292
+ d();
293
293
  };
294
294
  return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), o = setTimeout(() => {
295
295
  l(null, {
@@ -355,7 +355,7 @@ function or(e, t) {
355
355
  });
356
356
  }
357
357
  const oe = /* @__PURE__ */ new Map();
358
- function V(e) {
358
+ function B(e) {
359
359
  if (!e) throw new Error("import specifier is required");
360
360
  if (oe.has(e)) return oe.get(e);
361
361
  const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
@@ -364,7 +364,7 @@ function V(e) {
364
364
  return oe.set(e, t), t;
365
365
  }
366
366
  const ot = async () => {
367
- const e = await V("node-fetch");
367
+ const e = await B("node-fetch");
368
368
  return e.default || e;
369
369
  }, sr = async (e, t, r) => {
370
370
  const o = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
@@ -384,30 +384,30 @@ const ot = async () => {
384
384
  const s = async () => n != null && n.fetch ? (a, l) => sr(a, l, n) : typeof fetch > "u" ? ot() : fetch, i = async (a, l) => {
385
385
  var c;
386
386
  try {
387
- const h = await (await a(l.href)).text(), [u, d] = await Promise.all([V("path"), V("vm")]), m = {
387
+ const d = await (await a(l.href)).text(), [h, f] = await Promise.all([B("path"), B("vm")]), p = {
388
388
  exports: {},
389
389
  module: { exports: {} }
390
- }, y = l.pathname.split("/").slice(0, -1).join("/"), g = u.basename(l.pathname), p = new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
390
+ }, m = l.pathname.split("/").slice(0, -1).join("/"), g = h.basename(l.pathname), y = new f.Script(`(function(exports, module, require, __dirname, __filename) {${d}
391
391
  })`, {
392
392
  filename: g,
393
- importModuleDynamically: ((c = d.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? V
393
+ importModuleDynamically: ((c = f.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? B
394
394
  });
395
395
  let E;
396
- E = (await V("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : u.join(process.cwd(), "__mf_require_base__.js")), p.runInThisContext()(m.exports, m.module, E, y, g);
397
- const b = m.module.exports || m.exports;
396
+ E = (await B("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : h.join(process.cwd(), "__mf_require_base__.js")), y.runInThisContext()(p.exports, p.module, E, m, g);
397
+ const b = p.module.exports || p.exports;
398
398
  if (r && b && r.globalName) {
399
399
  t(void 0, b[r.globalName] || b);
400
400
  return;
401
401
  }
402
402
  t(void 0, b);
403
- } catch (f) {
404
- t(f instanceof Error ? f : /* @__PURE__ */ new Error(`Script execution error: ${f}`));
403
+ } catch (u) {
404
+ t(u instanceof Error ? u : /* @__PURE__ */ new Error(`Script execution error: ${u}`));
405
405
  }
406
406
  };
407
407
  s().then(async (a) => {
408
408
  if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return Te(o.href, {
409
409
  fetch: a,
410
- vm: await V("vm")
410
+ vm: await B("vm")
411
411
  }).then(async (l) => {
412
412
  await l.evaluate(), t(void 0, l.namespace);
413
413
  }).catch((l) => {
@@ -453,9 +453,9 @@ function lr(e, t, r, n, o, s) {
453
453
  }
454
454
  const H = "[ Federation Runtime ]", ve = tt(H);
455
455
  function P(e, t, r, n, o) {
456
- e || S(t);
456
+ e || $(t);
457
457
  }
458
- function S(e, t, r, n, o) {
458
+ function $(e, t, r, n, o) {
459
459
  if (t !== void 0) return lr(e, t, r ?? {}, (i) => {
460
460
  throw new Error(`${H}: ${i}`);
461
461
  }, n);
@@ -524,7 +524,7 @@ function le(e, t) {
524
524
  return Object.hasOwnProperty.call(e, t);
525
525
  }
526
526
  le(I, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ce(I, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
527
- const B = I.__GLOBAL_LOADING_REMOTE_ENTRY__;
527
+ const V = I.__GLOBAL_LOADING_REMOTE_ENTRY__;
528
528
  function lt(e) {
529
529
  var t, r, n, o, s, i;
530
530
  le(e, "__VMOK__") && !le(e, "__FEDERATION__") && ce(e, "__FEDERATION__", e.__VMOK__), le(e, "__FEDERATION__") || (ce(e, "__FEDERATION__", {
@@ -538,8 +538,8 @@ function lt(e) {
538
538
  }
539
539
  lt(I);
540
540
  lt(k);
541
- function mr(e, t = we()) {
542
- t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.3.1");
541
+ function pr(e, t = we()) {
542
+ t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.3.2");
543
543
  }
544
544
  function q(e, t) {
545
545
  if (typeof t == "string") {
@@ -561,16 +561,16 @@ function q(e, t) {
561
561
  key: t
562
562
  };
563
563
  }
564
- } else S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
564
+ } else $(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
565
565
  }
566
- const Ge = () => k.__FEDERATION__.moduleInfo, pr = (e, t) => {
566
+ const Ge = () => k.__FEDERATION__.moduleInfo, mr = (e, t) => {
567
567
  const r = q(t, Z(e)).value;
568
568
  if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
569
569
  if ("version" in e && e.version) {
570
570
  const { version: n, ...o } = e, s = Z(o), i = q(k.__FEDERATION__.moduleInfo, s).value;
571
571
  if ((i == null ? void 0 : i.version) === n) return i;
572
572
  }
573
- }, ue = (e) => pr(e, k.__FEDERATION__.moduleInfo), xe = (e, t) => {
573
+ }, ue = (e) => mr(e, k.__FEDERATION__.moduleInfo), xe = (e, t) => {
574
574
  const r = Z(e);
575
575
  return k.__FEDERATION__.moduleInfo[r] = t, k.__FEDERATION__.moduleInfo;
576
576
  }, yr = (e) => (k.__FEDERATION__.moduleInfo = {
@@ -585,14 +585,14 @@ const Ge = () => k.__FEDERATION__.moduleInfo, pr = (e, t) => {
585
585
  remoteEntryKey: r,
586
586
  entryExports: I[r]
587
587
  };
588
- }, gr = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, Er = (e) => I.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => I.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", fe = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ve = `(?:${fe}|${ut})`, br = `(?:-?(${Ve}(?:\\.${Ve})*))`, Be = `(?:${Y}|${ut})`, ft = `(?:-(${Be}(?:\\.${Be})*))`, be = `${Y}|x|X|\\*`, K = `[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${fe})\\.(${fe})\\.(${fe})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Ir = "(<|>)?=?\\s*\\*", Tr = `^${dt}${K}$`, vr = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${ft}?${De}?`, Ar = `^${ht}${K}$`, Pr = `^${Fe}\\s*${K}$`, kr = `^${Fe}\\s*(${vr})$|^$`, Or = "^\\s*>=\\s*0.0.0\\s*$";
588
+ }, gr = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, Er = (e) => I.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => I.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", fe = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Be = `(?:${fe}|${ut})`, br = `(?:-?(${Be}(?:\\.${Be})*))`, Ve = `(?:${Y}|${ut})`, ft = `(?:-(${Ve}(?:\\.${Ve})*))`, be = `${Y}|x|X|\\*`, K = `[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${fe})\\.(${fe})\\.(${fe})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Ir = "(<|>)?=?\\s*\\*", Tr = `^${dt}${K}$`, vr = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${ft}?${De}?`, Ar = `^${ht}${K}$`, Pr = `^${Fe}\\s*${K}$`, kr = `^${Fe}\\s*(${vr})$|^$`, Or = "^\\s*>=\\s*0.0.0\\s*$";
589
589
  function M(e) {
590
590
  return new RegExp(e);
591
591
  }
592
592
  function T(e) {
593
593
  return !e || e.toLowerCase() === "x" || e === "*";
594
594
  }
595
- function mt(...e) {
595
+ function pt(...e) {
596
596
  return (t) => e.reduce((r, n) => n(r), t);
597
597
  }
598
598
  function We(e) {
@@ -603,7 +603,7 @@ function je(e, t, r, n) {
603
603
  return n ? `${o}-${n}` : o;
604
604
  }
605
605
  function Lr(e) {
606
- return e.replace(M(Rr), (t, r, n, o, s, i, a, l, c, f, h, u) => (T(n) ? r = "" : T(o) ? r = `>=${n}.0.0` : T(s) ? r = `>=${n}.${o}.0` : r = `>=${r}`, T(c) ? l = "" : T(f) ? l = `<${Number(c) + 1}.0.0-0` : T(h) ? l = `<${c}.${Number(f) + 1}.0-0` : u ? l = `<=${c}.${f}.${h}-${u}` : l = `<=${l}`, `${r} ${l}`.trim()));
606
+ return e.replace(M(Rr), (t, r, n, o, s, i, a, l, c, u, d, h) => (T(n) ? r = "" : T(o) ? r = `>=${n}.0.0` : T(s) ? r = `>=${n}.${o}.0` : r = `>=${r}`, T(c) ? l = "" : T(u) ? l = `<${Number(c) + 1}.0.0-0` : T(d) ? l = `<${c}.${Number(u) + 1}.0-0` : h ? l = `<=${c}.${u}.${d}-${h}` : l = `<=${l}`, `${r} ${l}`.trim()));
607
607
  }
608
608
  function Mr(e) {
609
609
  return e.replace(M($r), "$1$2$3");
@@ -622,8 +622,8 @@ function Hr(e) {
622
622
  }
623
623
  function Gr(e) {
624
624
  return e.split(/\s+/).map((t) => t.trim().replace(M(Pr), (r, n, o, s, i, a) => {
625
- const l = T(o), c = l || T(s), f = c || T(i);
626
- return n === "=" && f && (n = ""), a = "", l ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && f ? (c && (s = 0), i = 0, n === ">" ? (n = ">=", c ? (o = Number(o) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : n === "<=" && (n = "<", c ? o = Number(o) + 1 : s = Number(s) + 1), n === "<" && (a = "-0"), `${n + o}.${s}.${i}${a}`) : c ? `>=${o}.0.0${a} <${Number(o) + 1}.0.0-0` : f ? `>=${o}.${s}.0${a} <${o}.${Number(s) + 1}.0-0` : r;
625
+ const l = T(o), c = l || T(s), u = c || T(i);
626
+ return n === "=" && u && (n = ""), a = "", l ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && u ? (c && (s = 0), i = 0, n === ">" ? (n = ">=", c ? (o = Number(o) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : n === "<=" && (n = "<", c ? o = Number(o) + 1 : s = Number(s) + 1), n === "<" && (a = "-0"), `${n + o}.${s}.${i}${a}`) : c ? `>=${o}.0.0${a} <${Number(o) + 1}.0.0-0` : u ? `>=${o}.${s}.0${a} <${o}.${Number(s) + 1}.0-0` : r;
627
627
  })).join(" ");
628
628
  }
629
629
  function xr(e) {
@@ -635,7 +635,7 @@ function Ur(e) {
635
635
  function he(e, t) {
636
636
  return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
637
637
  }
638
- function Vr(e, t) {
638
+ function Br(e, t) {
639
639
  const { preRelease: r } = e, { preRelease: n } = t;
640
640
  if (r === void 0 && n) return 1;
641
641
  if (r && n === void 0) return -1;
@@ -648,12 +648,12 @@ function Vr(e, t) {
648
648
  return 0;
649
649
  }
650
650
  function se(e, t) {
651
- return he(e.major, t.major) || he(e.minor, t.minor) || he(e.patch, t.patch) || Vr(e, t);
651
+ return he(e.major, t.major) || he(e.minor, t.minor) || he(e.patch, t.patch) || Br(e, t);
652
652
  }
653
653
  function Re(e, t) {
654
654
  return e.version === t.version;
655
655
  }
656
- function Br(e, t) {
656
+ function Vr(e, t) {
657
657
  switch (e.operator) {
658
658
  case "":
659
659
  case "=":
@@ -673,10 +673,10 @@ function Br(e, t) {
673
673
  }
674
674
  }
675
675
  function Wr(e) {
676
- return mt(Fr, Hr, Gr, xr)(e);
676
+ return pt(Fr, Hr, Gr, xr)(e);
677
677
  }
678
678
  function jr(e) {
679
- return mt(Lr, Mr, Cr, Dr)(e.trim()).split(/\s+/).join(" ");
679
+ return pt(Lr, Mr, Cr, Dr)(e.trim()).split(/\s+/).join(" ");
680
680
  }
681
681
  function X(e, t) {
682
682
  if (!e) return !1;
@@ -690,51 +690,51 @@ function X(e, t) {
690
690
  patch: i,
691
691
  preRelease: a == null ? void 0 : a.split(".")
692
692
  }, c = t.split("||");
693
- for (const f of c) {
694
- const h = f.trim();
695
- if (!h || h === "*" || h === "x") return !0;
693
+ for (const u of c) {
694
+ const d = u.trim();
695
+ if (!d || d === "*" || d === "x") return !0;
696
696
  try {
697
- const u = jr(h);
698
- if (!u.trim()) return !0;
699
- const d = u.split(" ").map((g) => Wr(g)).join(" ");
700
- if (!d.trim()) return !0;
701
- const m = d.split(/\s+/).map((g) => Ur(g)).filter(Boolean);
702
- if (m.length === 0) continue;
703
- let y = !0;
704
- for (const g of m) {
705
- const p = We(g);
706
- if (!p) {
707
- y = !1;
697
+ const h = jr(d);
698
+ if (!h.trim()) return !0;
699
+ const f = h.split(" ").map((g) => Wr(g)).join(" ");
700
+ if (!f.trim()) return !0;
701
+ const p = f.split(/\s+/).map((g) => Ur(g)).filter(Boolean);
702
+ if (p.length === 0) continue;
703
+ let m = !0;
704
+ for (const g of p) {
705
+ const y = We(g);
706
+ if (!y) {
707
+ m = !1;
708
708
  break;
709
709
  }
710
- const [, E, , b, N, _, $] = p;
711
- if (!Br({
710
+ const [, E, , b, S, _, w] = y;
711
+ if (!Vr({
712
712
  operator: E,
713
- version: je(b, N, _, $),
713
+ version: je(b, S, _, w),
714
714
  major: b,
715
- minor: N,
715
+ minor: S,
716
716
  patch: _,
717
- preRelease: $ == null ? void 0 : $.split(".")
717
+ preRelease: w == null ? void 0 : w.split(".")
718
718
  }, l)) {
719
- y = !1;
719
+ m = !1;
720
720
  break;
721
721
  }
722
722
  }
723
- if (y) return !0;
724
- } catch (u) {
725
- console.error(`[semver] Error processing range part "${h}":`, u);
723
+ if (m) return !0;
724
+ } catch (h) {
725
+ console.error(`[semver] Error processing range part "${d}":`, h);
726
726
  continue;
727
727
  }
728
728
  }
729
729
  return !1;
730
730
  }
731
- const re = "default", pt = "global";
731
+ const re = "default", mt = "global";
732
732
  function qr(e, t, r, n) {
733
733
  var s, i;
734
734
  let o;
735
735
  return "get" in e ? o = e.get : "lib" in e ? o = () => Promise.resolve(e.lib) : o = () => Promise.resolve(() => {
736
- S(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
737
- }), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && S(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
736
+ $(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
737
+ }), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && $(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
738
738
  deps: [],
739
739
  useIn: [],
740
740
  from: t,
@@ -798,7 +798,7 @@ const te = (e, t) => {
798
798
  return G(n, o);
799
799
  };
800
800
  return Object.keys(e).reduce((n, o) => !n || r(n, o) || n === "0" ? o : n, 0);
801
- }, me = (e) => !!e.loaded || typeof e.lib == "function", Kr = (e) => !!e.loading, zr = (e, t) => {
801
+ }, pe = (e) => !!e.loaded || typeof e.lib == "function", Kr = (e) => !!e.loading, zr = (e, t) => {
802
802
  if (!e || !t) return !1;
803
803
  const { usedExports: r } = e;
804
804
  return r ? !!t.every((n) => r.includes(n)) : !1;
@@ -807,7 +807,7 @@ function Jr(e, t, r, n) {
807
807
  const o = e[t][r];
808
808
  let s = "", i = ee(n);
809
809
  const a = function(l, c) {
810
- return i ? o[l].treeShaking ? o[c].treeShaking ? !me(o[l].treeShaking) && G(l, c) : !1 : !0 : !me(o[l]) && G(l, c);
810
+ return i ? o[l].treeShaking ? o[c].treeShaking ? !pe(o[l].treeShaking) && G(l, c) : !1 : !0 : !pe(o[l]) && G(l, c);
811
811
  };
812
812
  if (i) {
813
813
  if (s = te(e[t][r], a), s) return {
@@ -821,7 +821,7 @@ function Jr(e, t, r, n) {
821
821
  useTreesShaking: i
822
822
  };
823
823
  }
824
- const x = (e) => me(e) || Kr(e);
824
+ const x = (e) => pe(e) || Kr(e);
825
825
  function Xr(e, t, r, n) {
826
826
  const o = e[t][r];
827
827
  let s = "", i = ee(n);
@@ -853,50 +853,50 @@ function de(e, t, r, n) {
853
853
  if (!e) return;
854
854
  const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r, l = Array.isArray(s) ? s : [s];
855
855
  for (const c of l) if (o && e[c] && e[c][t]) {
856
- const { requiredVersion: f } = o, { version: h, useTreesShaking: u } = Yr(i)(e, c, t, a), d = () => {
857
- const y = e[c][t][h];
856
+ const { requiredVersion: u } = o, { version: d, useTreesShaking: h } = Yr(i)(e, c, t, a), f = () => {
857
+ const m = e[c][t][d];
858
858
  if (o.singleton) {
859
- if (typeof f == "string" && !X(h, f)) {
860
- const g = `Version ${h} from ${h && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
861
- o.strictVersion ? S(g) : Oe(g);
859
+ if (typeof u == "string" && !X(d, u)) {
860
+ const g = `Version ${d} from ${d && m.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
861
+ o.strictVersion ? $(g) : Oe(g);
862
862
  }
863
863
  return {
864
- shared: y,
865
- useTreesShaking: u
864
+ shared: m,
865
+ useTreesShaking: h
866
866
  };
867
867
  } else {
868
- if (f === !1 || f === "*") return {
869
- shared: y,
870
- useTreesShaking: u
868
+ if (u === !1 || u === "*") return {
869
+ shared: m,
870
+ useTreesShaking: h
871
871
  };
872
- if (X(h, f)) return {
873
- shared: y,
874
- useTreesShaking: u
872
+ if (X(d, u)) return {
873
+ shared: m,
874
+ useTreesShaking: h
875
875
  };
876
876
  const g = ee(a);
877
877
  if (g) {
878
- for (const [p, E] of Object.entries(e[c][t]))
879
- if (ee(E.treeShaking, a == null ? void 0 : a.usedExports) && X(p, f))
878
+ for (const [y, E] of Object.entries(e[c][t]))
879
+ if (ee(E.treeShaking, a == null ? void 0 : a.usedExports) && X(y, u))
880
880
  return {
881
881
  shared: E,
882
882
  useTreesShaking: g
883
883
  };
884
884
  }
885
- for (const [p, E] of Object.entries(e[c][t])) if (X(p, f)) return {
885
+ for (const [y, E] of Object.entries(e[c][t])) if (X(y, u)) return {
886
886
  shared: E,
887
887
  useTreesShaking: !1
888
888
  };
889
889
  }
890
- }, m = {
890
+ }, p = {
891
891
  shareScopeMap: e,
892
892
  scope: c,
893
893
  pkgName: t,
894
- version: h,
894
+ version: d,
895
895
  GlobalFederation: Q.__FEDERATION__,
896
896
  shareInfo: r,
897
- resolver: d
897
+ resolver: f
898
898
  };
899
- return (n.emit(m) || m).resolver();
899
+ return (n.emit(p) || p).resolver();
900
900
  }
901
901
  }
902
902
  function gt() {
@@ -906,18 +906,18 @@ function qe(e) {
906
906
  const { pkgName: t, extraOptions: r, shareInfos: n } = e, o = (l) => {
907
907
  if (!l) return;
908
908
  const c = {};
909
- return l.forEach((h) => {
910
- c[h.version] = h;
911
- }), c[te(c, function(h, u) {
912
- return !me(c[h]) && G(h, u);
909
+ return l.forEach((d) => {
910
+ c[d.version] = d;
911
+ }), c[te(c, function(d, h) {
912
+ return !pe(c[d]) && G(d, h);
913
913
  })];
914
914
  }, s = (r == null ? void 0 : r.resolver) ?? o, i = (l) => l !== null && typeof l == "object" && !Array.isArray(l), a = (...l) => {
915
915
  const c = {};
916
- for (const f of l)
917
- if (f)
918
- for (const [h, u] of Object.entries(f)) {
919
- const d = c[h];
920
- i(d) && i(u) ? c[h] = a(d, u) : u !== void 0 && (c[h] = u);
916
+ for (const u of l)
917
+ if (u)
918
+ for (const [d, h] of Object.entries(u)) {
919
+ const f = c[d];
920
+ i(f) && i(h) ? c[d] = a(f, h) : h !== void 0 && (c[d] = h);
921
921
  }
922
922
  return c;
923
923
  };
@@ -996,7 +996,7 @@ async function rn({ entry: e, remoteEntryExports: t }) {
996
996
  e
997
997
  ).then(r).catch(n);
998
998
  } catch (o) {
999
- S(`Failed to load ESM entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
999
+ $(`Failed to load ESM entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
1000
1000
  }
1001
1001
  });
1002
1002
  }
@@ -1005,13 +1005,13 @@ async function nn({ entry: e, remoteEntryExports: t }) {
1005
1005
  try {
1006
1006
  t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${It}`)([r, n]);
1007
1007
  } catch (o) {
1008
- S(`Failed to load SystemJS entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
1008
+ $(`Failed to load SystemJS entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
1009
1009
  }
1010
1010
  });
1011
1011
  }
1012
1012
  function Tt(e, t, r) {
1013
1013
  const { remoteEntryKey: n, entryExports: o } = Ce(e, t);
1014
- return o || S(Et, O, {
1014
+ return o || $(Et, O, {
1015
1015
  remoteName: e,
1016
1016
  remoteEntryUrl: r,
1017
1017
  remoteEntryKey: n
@@ -1033,7 +1033,7 @@ async function on({ name: e, globalName: t, entry: r, loaderHook: n, getEntryUrl
1033
1033
  }
1034
1034
  }).then(() => Tt(e, t, r), (a) => {
1035
1035
  const l = a instanceof Error ? a.message : String(a);
1036
- S(He, O, {
1036
+ $(He, O, {
1037
1037
  remoteName: e,
1038
1038
  resourceUrl: i
1039
1039
  }, l);
@@ -1080,19 +1080,19 @@ async function an({ remoteInfo: e, loaderHook: t }) {
1080
1080
  return c;
1081
1081
  } }
1082
1082
  }).then(() => Tt(o, n, r)).catch((a) => {
1083
- S(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error ? a.message : String(a)}`);
1083
+ $(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error ? a.message : String(a)}`);
1084
1084
  });
1085
1085
  }
1086
1086
  function Pe(e) {
1087
1087
  const { entry: t, name: r } = e;
1088
1088
  return Xe(r, t);
1089
1089
  }
1090
- async function pe(e) {
1090
+ async function me(e) {
1091
1091
  const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i = Pe(n);
1092
1092
  if (r) return r;
1093
- if (!B[i]) {
1093
+ if (!V[i]) {
1094
1094
  const a = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
1095
- B[i] = a.emit({
1095
+ V[i] = a.emit({
1096
1096
  loaderHook: l,
1097
1097
  remoteInfo: n,
1098
1098
  remoteEntryExports: r
@@ -1105,31 +1105,31 @@ async function pe(e) {
1105
1105
  remoteInfo: n,
1106
1106
  loaderHook: l
1107
1107
  }))).catch(async (c) => {
1108
- const f = Pe(n), h = c instanceof Error && c.message.includes("ScriptExecutionError");
1109
- if (c instanceof Error && c.message.includes(He) && !h && !s) {
1110
- const u = (m) => pe({
1111
- ...m,
1108
+ const u = Pe(n), d = c instanceof Error && c.message.includes("ScriptExecutionError");
1109
+ if (c instanceof Error && c.message.includes(He) && !d && !s) {
1110
+ const h = (p) => me({
1111
+ ...p,
1112
1112
  _inErrorHandling: !0
1113
- }), d = await t.loaderHook.lifecycle.loadEntryError.emit({
1114
- getRemoteEntry: u,
1113
+ }), f = await t.loaderHook.lifecycle.loadEntryError.emit({
1114
+ getRemoteEntry: h,
1115
1115
  origin: t,
1116
1116
  remoteInfo: n,
1117
1117
  remoteEntryExports: r,
1118
- globalLoading: B,
1119
- uniqueKey: f
1118
+ globalLoading: V,
1119
+ uniqueKey: u
1120
1120
  });
1121
- if (d) return d;
1121
+ if (f) return f;
1122
1122
  }
1123
1123
  throw c;
1124
1124
  });
1125
1125
  }
1126
- return B[i];
1126
+ return V[i];
1127
1127
  }
1128
1128
  function ke(e) {
1129
1129
  return {
1130
1130
  ...e,
1131
1131
  entry: "entry" in e ? e.entry : "",
1132
- type: e.type || pt,
1132
+ type: e.type || mt,
1133
1133
  entryGlobalName: e.entryGlobalName || e.name,
1134
1134
  shareScope: e.shareScope || re
1135
1135
  };
@@ -1169,13 +1169,13 @@ function z(e) {
1169
1169
  var r, n, o, s, i, a;
1170
1170
  const t = {};
1171
1171
  for (const [l, c] of Object.entries(e.shared)) {
1172
- const f = c[0];
1173
- f && (t[l] = {
1174
- version: f.version,
1175
- singleton: (r = f.shareConfig) == null ? void 0 : r.singleton,
1176
- requiredVersion: ((n = f.shareConfig) == null ? void 0 : n.requiredVersion) === !1 ? !1 : (o = f.shareConfig) == null ? void 0 : o.requiredVersion,
1177
- eager: f.eager,
1178
- strictVersion: (s = f.shareConfig) == null ? void 0 : s.strictVersion
1172
+ const u = c[0];
1173
+ u && (t[l] = {
1174
+ version: u.version,
1175
+ singleton: (r = u.shareConfig) == null ? void 0 : r.singleton,
1176
+ requiredVersion: ((n = u.shareConfig) == null ? void 0 : n.requiredVersion) === !1 ? !1 : (o = u.shareConfig) == null ? void 0 : o.requiredVersion,
1177
+ eager: u.eager,
1178
+ strictVersion: (s = u.shareConfig) == null ? void 0 : s.strictVersion
1179
1179
  });
1180
1180
  }
1181
1181
  return {
@@ -1219,7 +1219,7 @@ function At(e, t, r, n = !0) {
1219
1219
  if (t.options.inBrowser) {
1220
1220
  if (i.forEach((a) => {
1221
1221
  const { moduleInfo: l } = a, c = t.moduleCache.get(e.name);
1222
- pe(c ? {
1222
+ me(c ? {
1223
1223
  origin: t,
1224
1224
  remoteInfo: l,
1225
1225
  remoteEntryExports: c.remoteEntryExports
@@ -1234,20 +1234,20 @@ function At(e, t, r, n = !0) {
1234
1234
  as: "style"
1235
1235
  };
1236
1236
  o.forEach((l) => {
1237
- const { link: c, needAttach: f } = Ee({
1237
+ const { link: c, needAttach: u } = Ee({
1238
1238
  url: l,
1239
1239
  cb: () => {
1240
1240
  },
1241
1241
  attrs: a,
1242
- createLinkHook: (h, u) => {
1243
- const d = t.loaderHook.lifecycle.createLink.emit({
1244
- url: h,
1245
- attrs: u
1242
+ createLinkHook: (d, h) => {
1243
+ const f = t.loaderHook.lifecycle.createLink.emit({
1244
+ url: d,
1245
+ attrs: h
1246
1246
  });
1247
- if (d instanceof HTMLLinkElement) return d;
1247
+ if (f instanceof HTMLLinkElement) return f;
1248
1248
  }
1249
1249
  });
1250
- f && document.head.appendChild(c);
1250
+ u && document.head.appendChild(c);
1251
1251
  });
1252
1252
  } else {
1253
1253
  const a = {
@@ -1255,21 +1255,21 @@ function At(e, t, r, n = !0) {
1255
1255
  type: "text/css"
1256
1256
  };
1257
1257
  o.forEach((l) => {
1258
- const { link: c, needAttach: f } = Ee({
1258
+ const { link: c, needAttach: u } = Ee({
1259
1259
  url: l,
1260
1260
  cb: () => {
1261
1261
  },
1262
1262
  attrs: a,
1263
- createLinkHook: (h, u) => {
1264
- const d = t.loaderHook.lifecycle.createLink.emit({
1265
- url: h,
1266
- attrs: u
1263
+ createLinkHook: (d, h) => {
1264
+ const f = t.loaderHook.lifecycle.createLink.emit({
1265
+ url: d,
1266
+ attrs: h
1267
1267
  });
1268
- if (d instanceof HTMLLinkElement) return d;
1268
+ if (f instanceof HTMLLinkElement) return f;
1269
1269
  },
1270
1270
  needDeleteLink: !1
1271
1271
  });
1272
- f && document.head.appendChild(c);
1272
+ u && document.head.appendChild(c);
1273
1273
  });
1274
1274
  }
1275
1275
  if (n) {
@@ -1278,20 +1278,20 @@ function At(e, t, r, n = !0) {
1278
1278
  as: "script"
1279
1279
  };
1280
1280
  s.forEach((l) => {
1281
- const { link: c, needAttach: f } = Ee({
1281
+ const { link: c, needAttach: u } = Ee({
1282
1282
  url: l,
1283
1283
  cb: () => {
1284
1284
  },
1285
1285
  attrs: a,
1286
- createLinkHook: (h, u) => {
1287
- const d = t.loaderHook.lifecycle.createLink.emit({
1288
- url: h,
1289
- attrs: u
1286
+ createLinkHook: (d, h) => {
1287
+ const f = t.loaderHook.lifecycle.createLink.emit({
1288
+ url: d,
1289
+ attrs: h
1290
1290
  });
1291
- if (d instanceof HTMLLinkElement) return d;
1291
+ if (f instanceof HTMLLinkElement) return f;
1292
1292
  }
1293
1293
  });
1294
- f && document.head.appendChild(c);
1294
+ u && document.head.appendChild(c);
1295
1295
  });
1296
1296
  } else {
1297
1297
  const a = {
@@ -1299,21 +1299,21 @@ function At(e, t, r, n = !0) {
1299
1299
  type: (e == null ? void 0 : e.type) === "module" ? "module" : "text/javascript"
1300
1300
  };
1301
1301
  s.forEach((l) => {
1302
- const { script: c, needAttach: f } = nt({
1302
+ const { script: c, needAttach: u } = nt({
1303
1303
  url: l,
1304
1304
  cb: () => {
1305
1305
  },
1306
1306
  attrs: a,
1307
- createScriptHook: (h, u) => {
1308
- const d = t.loaderHook.lifecycle.createScript.emit({
1309
- url: h,
1310
- attrs: u
1307
+ createScriptHook: (d, h) => {
1308
+ const f = t.loaderHook.lifecycle.createScript.emit({
1309
+ url: d,
1310
+ attrs: h
1311
1311
  });
1312
- if (d instanceof HTMLScriptElement) return d;
1312
+ if (f instanceof HTMLScriptElement) return f;
1313
1313
  },
1314
1314
  needDeleteScript: !0
1315
1315
  });
1316
- f && document.head.appendChild(c);
1316
+ u && document.head.appendChild(c);
1317
1317
  });
1318
1318
  }
1319
1319
  }
@@ -1342,7 +1342,7 @@ var Pt = class {
1342
1342
  }
1343
1343
  async getEntry() {
1344
1344
  if (this.remoteEntryExports) return this.remoteEntryExports;
1345
- const e = await pe({
1345
+ const e = await me({
1346
1346
  origin: this.host,
1347
1347
  remoteInfo: this.remoteInfo,
1348
1348
  remoteEntryExports: this.remoteEntryExports
@@ -1363,7 +1363,7 @@ var Pt = class {
1363
1363
  remoteInfo: this.remoteInfo,
1364
1364
  origin: this.host
1365
1365
  });
1366
- typeof (n == null ? void 0 : n.init) > "u" && S(_t, O, {
1366
+ typeof (n == null ? void 0 : n.init) > "u" && $(_t, O, {
1367
1367
  hostName: this.host.name,
1368
1368
  remoteName: this.remoteInfo.name,
1369
1369
  remoteEntryUrl: this.remoteInfo.entry,
@@ -1455,10 +1455,10 @@ function kt(e, t) {
1455
1455
  }
1456
1456
  var W = class extends v {
1457
1457
  constructor(e) {
1458
- super(), this.onerror = S, this.type = e;
1458
+ super(), this.onerror = $, this.type = e;
1459
1459
  }
1460
1460
  emit(e) {
1461
- Me(e) || S(`The data for the "${this.type}" hook should be an object.`);
1461
+ Me(e) || $(`The data for the "${this.type}" hook should be an object.`);
1462
1462
  for (const t of this.listeners) try {
1463
1463
  const r = t(e);
1464
1464
  if (kt(e, r)) e = r;
@@ -1473,10 +1473,10 @@ var W = class extends v {
1473
1473
  }
1474
1474
  }, D = class extends v {
1475
1475
  constructor(e) {
1476
- super(), this.onerror = S, this.type = e;
1476
+ super(), this.onerror = $, this.type = e;
1477
1477
  }
1478
1478
  emit(e) {
1479
- Me(e) || S(`The response data for the "${this.type}" hook must be an object.`);
1479
+ Me(e) || $(`The response data for the "${this.type}" hook must be an object.`);
1480
1480
  const t = Array.from(this.listeners);
1481
1481
  if (t.length > 0) {
1482
1482
  let r = 0;
@@ -1517,11 +1517,11 @@ var W = class extends v {
1517
1517
  };
1518
1518
  function Ot(e, t) {
1519
1519
  const r = ct(t);
1520
- r.url || S(Nt, O, { remoteName: e.name });
1520
+ r.url || $(Nt, O, { remoteName: e.name });
1521
1521
  let n = Ne(t, r.url);
1522
1522
  !F && !n.startsWith("http") && (n = `https:${n}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = n, e.version = t.version, e.buildVersion = t.buildVersion;
1523
1523
  }
1524
- function mn() {
1524
+ function pn() {
1525
1525
  return {
1526
1526
  name: "snapshot-plugin",
1527
1527
  async afterResolve(e) {
@@ -1541,7 +1541,7 @@ function mn() {
1541
1541
  share: !1,
1542
1542
  depsRemote: !1
1543
1543
  }
1544
- }, f = await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1544
+ }, u = await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1545
1545
  origin: o,
1546
1546
  preloadOptions: c,
1547
1547
  remoteInfo: s,
@@ -1549,7 +1549,7 @@ function mn() {
1549
1549
  remoteSnapshot: a,
1550
1550
  globalSnapshot: l
1551
1551
  });
1552
- return f && At(s, o, f, !1), {
1552
+ return u && At(s, o, u, !1), {
1553
1553
  ...e,
1554
1554
  remoteSnapshot: a
1555
1555
  };
@@ -1558,7 +1558,7 @@ function mn() {
1558
1558
  }
1559
1559
  };
1560
1560
  }
1561
- function pn(e) {
1561
+ function mn(e) {
1562
1562
  const t = e.split(":");
1563
1563
  return t.length === 1 ? {
1564
1564
  name: t[0],
@@ -1578,85 +1578,85 @@ function Lt(e, t, r, n, o = {}, s) {
1578
1578
  for (const c of l) {
1579
1579
  if (o[c]) continue;
1580
1580
  o[c] = !0;
1581
- const f = pn(c), h = a.remotesInfo[c];
1581
+ const u = mn(c), d = a.remotesInfo[c];
1582
1582
  Lt(e, {
1583
- name: f.name,
1584
- version: h.matchedVersion
1583
+ name: u.name,
1584
+ version: d.matchedVersion
1585
1585
  }, r, !1, o, void 0);
1586
1586
  }
1587
1587
  }
1588
1588
  }
1589
1589
  const Se = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
1590
1590
  function yn(e, t, r, n, o) {
1591
- const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: f } = e, { preloadConfig: h } = t, { depsRemote: u } = h;
1592
- if (Lt(n, r, (m, y, g) => {
1593
- var $;
1594
- let p;
1595
- if (g) p = h;
1596
- else if (Array.isArray(u)) {
1597
- const R = u.find((w) => w.nameOrAlias === y.name || w.nameOrAlias === y.alias);
1591
+ const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: d } = t, { depsRemote: h } = d;
1592
+ if (Lt(n, r, (p, m, g) => {
1593
+ var w;
1594
+ let y;
1595
+ if (g) y = d;
1596
+ else if (Array.isArray(h)) {
1597
+ const R = h.find((N) => N.nameOrAlias === m.name || N.nameOrAlias === m.alias);
1598
1598
  if (!R) return;
1599
- p = vt(R);
1600
- } else if (u === !0) p = h;
1599
+ y = vt(R);
1600
+ } else if (h === !0) y = d;
1601
1601
  else return;
1602
- const E = Ne(m, ct(m).url);
1602
+ const E = Ne(p, ct(p).url);
1603
1603
  E && a.push({
1604
- name: y.name,
1604
+ name: m.name,
1605
1605
  moduleInfo: {
1606
- name: y.name,
1606
+ name: m.name,
1607
1607
  entry: E,
1608
- type: "remoteEntryType" in m ? m.remoteEntryType : "global",
1609
- entryGlobalName: "globalName" in m ? m.globalName : y.name,
1608
+ type: "remoteEntryType" in p ? p.remoteEntryType : "global",
1609
+ entryGlobalName: "globalName" in p ? p.globalName : m.name,
1610
1610
  shareScope: "",
1611
- version: "version" in m ? m.version : void 0
1611
+ version: "version" in p ? p.version : void 0
1612
1612
  },
1613
1613
  url: E
1614
1614
  });
1615
- let b = "modules" in m ? m.modules : [];
1616
- const N = hn(p.exposes);
1617
- N.length && "modules" in m && (b = ($ = m == null ? void 0 : m.modules) == null ? void 0 : $.reduce((R, w) => ((N == null ? void 0 : N.indexOf(w.moduleName)) !== -1 && R.push(w), R), []));
1615
+ let b = "modules" in p ? p.modules : [];
1616
+ const S = hn(y.exposes);
1617
+ S.length && "modules" in p && (b = (w = p == null ? void 0 : p.modules) == null ? void 0 : w.reduce((R, N) => ((S == null ? void 0 : S.indexOf(N.moduleName)) !== -1 && R.push(N), R), []));
1618
1618
  function _(R) {
1619
- const w = R.map((L) => Ne(m, L));
1620
- return p.filter ? w.filter(p.filter) : w;
1619
+ const N = R.map((L) => Ne(p, L));
1620
+ return y.filter ? N.filter(y.filter) : N;
1621
1621
  }
1622
1622
  if (b) {
1623
1623
  const R = b.length;
1624
- for (let w = 0; w < R; w++) {
1625
- const L = b[w], ye = `${y.name}/${L.moduleName}`;
1624
+ for (let N = 0; N < R; N++) {
1625
+ const L = b[N], ye = `${m.name}/${L.moduleName}`;
1626
1626
  e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1627
- id: L.moduleName === "." ? y.name : ye,
1628
- name: y.name,
1629
- remoteSnapshot: m,
1630
- preloadConfig: p,
1631
- remote: y,
1627
+ id: L.moduleName === "." ? m.name : ye,
1628
+ name: m.name,
1629
+ remoteSnapshot: p,
1630
+ preloadConfig: y,
1631
+ remote: m,
1632
1632
  origin: e
1633
- }), !Er(ye) && (p.resourceCategory === "all" ? (s.push(..._(L.assets.css.async)), s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.async)), i.push(..._(L.assets.js.sync))) : p.resourceCategory === "sync" && (s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.sync))), _r(ye));
1633
+ }), !Er(ye) && (y.resourceCategory === "all" ? (s.push(..._(L.assets.css.async)), s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.async)), i.push(..._(L.assets.js.sync))) : y.resourceCategory === "sync" && (s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.sync))), _r(ye));
1634
1634
  }
1635
1635
  }
1636
1636
  }, !0, {}, o), o.shared && o.shared.length > 0) {
1637
- const m = (y, g) => {
1638
- const { shared: p } = de(e.shareScopeMap, g.sharedName, y, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1639
- p && typeof p.lib == "function" && (g.assets.js.sync.forEach((E) => {
1637
+ const p = (m, g) => {
1638
+ const { shared: y } = de(e.shareScopeMap, g.sharedName, m, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1639
+ y && typeof y.lib == "function" && (g.assets.js.sync.forEach((E) => {
1640
1640
  l.add(E);
1641
1641
  }), g.assets.css.sync.forEach((E) => {
1642
1642
  c.add(E);
1643
1643
  }));
1644
1644
  };
1645
- o.shared.forEach((y) => {
1645
+ o.shared.forEach((m) => {
1646
1646
  var E;
1647
- const g = (E = f.shared) == null ? void 0 : E[y.sharedName];
1647
+ const g = (E = u.shared) == null ? void 0 : E[m.sharedName];
1648
1648
  if (!g) return;
1649
- const p = y.version ? g.find((b) => b.version === y.version) : g;
1650
- p && at(p).forEach((b) => {
1651
- m(b, y);
1649
+ const y = m.version ? g.find((b) => b.version === m.version) : g;
1650
+ y && at(y).forEach((b) => {
1651
+ p(b, m);
1652
1652
  });
1653
1653
  });
1654
1654
  }
1655
- const d = i.filter((m) => !l.has(m) && !Se("script", m));
1655
+ const f = i.filter((p) => !l.has(p) && !Se("script", p));
1656
1656
  return {
1657
- cssAssets: s.filter((m) => !c.has(m) && !Se("link", m)),
1658
- jsAssetsWithoutEntry: d,
1659
- entryAssets: a.filter((m) => !Se("script", m.url))
1657
+ cssAssets: s.filter((p) => !c.has(p) && !Se("link", p)),
1658
+ jsAssetsWithoutEntry: f,
1659
+ entryAssets: a.filter((p) => !Se("script", p.url))
1660
1660
  };
1661
1661
  }
1662
1662
  const gn = function() {
@@ -1741,31 +1741,31 @@ var En = class {
1741
1741
  remoteSnapshot: i,
1742
1742
  globalSnapshot: a
1743
1743
  });
1744
- let f, h;
1744
+ let u, d;
1745
1745
  if (l) if (Qe(l)) {
1746
- const u = F ? l.remoteEntry : l.ssrRemoteEntry || l.remoteEntry || "", d = await this.getManifestJson(u, e, {}), m = xe({
1746
+ const h = F ? l.remoteEntry : l.ssrRemoteEntry || l.remoteEntry || "", f = await this.getManifestJson(h, e, {}), p = xe({
1747
1747
  ...e,
1748
- entry: u
1749
- }, d);
1750
- f = d, h = m;
1748
+ entry: h
1749
+ }, f);
1750
+ u = f, d = p;
1751
1751
  } else {
1752
- const { remoteSnapshot: u } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1752
+ const { remoteSnapshot: h } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1753
1753
  options: this.HostInstance.options,
1754
1754
  moduleInfo: e,
1755
1755
  remoteSnapshot: l,
1756
1756
  from: "global"
1757
1757
  });
1758
- f = u, h = c;
1758
+ u = h, d = c;
1759
1759
  }
1760
1760
  else if (Le(e)) {
1761
- const u = await this.getManifestJson(e.entry, e, {}), d = xe(e, u), { remoteSnapshot: m } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1761
+ const h = await this.getManifestJson(e.entry, e, {}), f = xe(e, h), { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1762
1762
  options: this.HostInstance.options,
1763
1763
  moduleInfo: e,
1764
- remoteSnapshot: u,
1764
+ remoteSnapshot: h,
1765
1765
  from: "global"
1766
1766
  });
1767
- f = m, h = d;
1768
- } else S($t, O, {
1767
+ u = p, d = f;
1768
+ } else $($t, O, {
1769
1769
  remoteName: e.name,
1770
1770
  remoteVersion: e.version,
1771
1771
  hostName: this.HostInstance.options.name,
@@ -1776,10 +1776,10 @@ var En = class {
1776
1776
  host: this.HostInstance,
1777
1777
  options: n,
1778
1778
  moduleInfo: e,
1779
- remoteSnapshot: f
1779
+ remoteSnapshot: u
1780
1780
  }), {
1781
- remoteSnapshot: f,
1782
- globalSnapshot: h
1781
+ remoteSnapshot: u,
1782
+ globalSnapshot: d
1783
1783
  };
1784
1784
  }
1785
1785
  getGlobalRemoteInfo(e) {
@@ -1799,7 +1799,7 @@ var En = class {
1799
1799
  from: "runtime",
1800
1800
  lifecycle: "afterResolve",
1801
1801
  origin: this.HostInstance
1802
- }), s || (delete this.manifestLoading[e], S(bt, O, {
1802
+ }), s || (delete this.manifestLoading[e], $(bt, O, {
1803
1803
  manifestUrl: e,
1804
1804
  moduleName: t.name,
1805
1805
  hostName: this.HostInstance.options.name
@@ -1885,8 +1885,8 @@ var En = class {
1885
1885
  return a.loaded = !0, a.lib || (a.lib = l), U(a, r.options.name), l;
1886
1886
  } else {
1887
1887
  const c = (async () => {
1888
- const f = await a.get();
1889
- return U(a, r.options.name), a.loaded = !0, a.lib = f, f;
1888
+ const u = await a.get();
1889
+ return U(a, r.options.name), a.loaded = !0, a.lib = u, u;
1890
1890
  })();
1891
1891
  return this.setShared({
1892
1892
  pkgName: e,
@@ -1900,15 +1900,15 @@ var En = class {
1900
1900
  }
1901
1901
  } else {
1902
1902
  if (t != null && t.customShareInfo) return !1;
1903
- const a = ee(o.treeShaking), l = ie(o, a), f = (async () => {
1904
- const h = await l.get();
1905
- l.lib = h, l.loaded = !0, U(l, r.options.name);
1906
- const { shared: u, useTreesShaking: d } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1907
- if (u) {
1908
- const m = ie(u, d);
1909
- m.lib = h, m.loaded = !0, u.from = o.from;
1903
+ const a = ee(o.treeShaking), l = ie(o, a), u = (async () => {
1904
+ const d = await l.get();
1905
+ l.lib = d, l.loaded = !0, U(l, r.options.name);
1906
+ const { shared: h, useTreesShaking: f } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1907
+ if (h) {
1908
+ const p = ie(h, f);
1909
+ p.lib = d, p.loaded = !0, h.from = o.from;
1910
1910
  }
1911
- return h;
1911
+ return d;
1912
1912
  })();
1913
1913
  return this.setShared({
1914
1914
  pkgName: e,
@@ -1916,9 +1916,9 @@ var En = class {
1916
1916
  shared: o,
1917
1917
  from: r.options.name,
1918
1918
  lib: null,
1919
- loading: f,
1919
+ loading: u,
1920
1920
  treeShaking: a ? l : void 0
1921
- }), f;
1921
+ }), u;
1922
1922
  }
1923
1923
  }
1924
1924
  /**
@@ -1931,43 +1931,43 @@ var En = class {
1931
1931
  let s = t == null ? void 0 : t.initScope;
1932
1932
  const i = [];
1933
1933
  if (n !== "build") {
1934
- const { initTokens: u } = this;
1934
+ const { initTokens: h } = this;
1935
1935
  s || (s = []);
1936
- let d = u[e];
1937
- if (d || (d = u[e] = { from: this.host.name }), s.indexOf(d) >= 0) return i;
1938
- s.push(d);
1936
+ let f = h[e];
1937
+ if (f || (f = h[e] = { from: this.host.name }), s.indexOf(f) >= 0) return i;
1938
+ s.push(f);
1939
1939
  }
1940
1940
  const a = this.shareScopeMap, l = r.options.name;
1941
1941
  a[e] || (a[e] = {});
1942
- const c = a[e], f = (u, d) => {
1942
+ const c = a[e], u = (h, f) => {
1943
1943
  var b;
1944
- const { version: m, eager: y } = d;
1945
- c[u] = c[u] || {};
1946
- const g = c[u], p = g[m] && ie(g[m]), E = !!(p && ("eager" in p && p.eager || "shareConfig" in p && ((b = p.shareConfig) != null && b.eager)));
1947
- (!p || p.strategy !== "loaded-first" && !p.loaded && (!y != !E ? y : l > g[m].from)) && (g[m] = d);
1948
- }, h = async (u) => {
1949
- const { module: d } = await r.remoteHandler.getRemoteModuleAndOptions({ id: u });
1950
- let m;
1944
+ const { version: p, eager: m } = f;
1945
+ c[h] = c[h] || {};
1946
+ const g = c[h], y = g[p] && ie(g[p]), E = !!(y && ("eager" in y && y.eager || "shareConfig" in y && ((b = y.shareConfig) != null && b.eager)));
1947
+ (!y || y.strategy !== "loaded-first" && !y.loaded && (!m != !E ? m : l > g[p].from)) && (g[p] = f);
1948
+ }, d = async (h) => {
1949
+ const { module: f } = await r.remoteHandler.getRemoteModuleAndOptions({ id: h });
1950
+ let p;
1951
1951
  try {
1952
- m = await d.getEntry();
1953
- } catch (y) {
1954
- if (m = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1955
- id: u,
1956
- error: y,
1952
+ p = await f.getEntry();
1953
+ } catch (m) {
1954
+ if (p = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1955
+ id: h,
1956
+ error: m,
1957
1957
  from: "runtime",
1958
1958
  lifecycle: "beforeLoadShare",
1959
1959
  origin: r
1960
- }), !m) return;
1960
+ }), !p) return;
1961
1961
  } finally {
1962
- m != null && m.init && !d.initing && (d.remoteEntryExports = m, await d.init(void 0, void 0, s));
1962
+ p != null && p.init && !f.initing && (f.remoteEntryExports = p, await f.init(void 0, void 0, s));
1963
1963
  }
1964
1964
  };
1965
- return Object.keys(r.options.shared).forEach((u) => {
1966
- r.options.shared[u].forEach((d) => {
1967
- d.scope.includes(e) && f(u, d);
1965
+ return Object.keys(r.options.shared).forEach((h) => {
1966
+ r.options.shared[h].forEach((f) => {
1967
+ f.scope.includes(e) && u(h, f);
1968
1968
  });
1969
- }), (r.options.shareStrategy === "version-first" || o === "version-first") && r.options.remotes.forEach((u) => {
1970
- u.shareScope === e && i.push(h(u.name));
1969
+ }), (r.options.shareStrategy === "version-first" || o === "version-first") && r.options.remotes.forEach((h) => {
1970
+ h.shareScope === e && i.push(d(h.name));
1971
1971
  }), i;
1972
1972
  }
1973
1973
  loadShareSync(e, t) {
@@ -1999,7 +1999,7 @@ var En = class {
1999
1999
  return n.loaded || (n.loaded = !0), n.lib;
2000
2000
  if (n.get) {
2001
2001
  const i = n.get();
2002
- return i instanceof Promise && S((t == null ? void 0 : t.from) === "build" ? St : Ae, O, {
2002
+ return i instanceof Promise && $((t == null ? void 0 : t.from) === "build" ? St : Ae, O, {
2003
2003
  hostName: r.options.name,
2004
2004
  sharedPkgName: e
2005
2005
  }, void 0, z(r.options)), n.lib = i, this.setShared({
@@ -2010,7 +2010,7 @@ var En = class {
2010
2010
  shared: n
2011
2011
  }), n.lib;
2012
2012
  }
2013
- S(Ae, O, {
2013
+ $(Ae, O, {
2014
2014
  hostName: r.options.name,
2015
2015
  sharedPkgName: e
2016
2016
  }, void 0, z(r.options));
@@ -2026,21 +2026,21 @@ var En = class {
2026
2026
  });
2027
2027
  }
2028
2028
  setShared({ pkgName: e, shared: t, from: r, lib: n, loading: o, loaded: s, get: i, treeShaking: a }) {
2029
- const { version: l, scope: c = "default", ...f } = t, h = Array.isArray(c) ? c : [c], u = (d) => {
2030
- const m = (g, p, E) => {
2031
- E && !g[p] && (g[p] = E);
2032
- }, y = a ? d.treeShaking : d;
2033
- m(y, "loaded", s), m(y, "loading", o), m(y, "get", i);
2029
+ const { version: l, scope: c = "default", ...u } = t, d = Array.isArray(c) ? c : [c], h = (f) => {
2030
+ const p = (g, y, E) => {
2031
+ E && !g[y] && (g[y] = E);
2032
+ }, m = a ? f.treeShaking : f;
2033
+ p(m, "loaded", s), p(m, "loading", o), p(m, "get", i);
2034
2034
  };
2035
- h.forEach((d) => {
2036
- this.shareScopeMap[d] || (this.shareScopeMap[d] = {}), this.shareScopeMap[d][e] || (this.shareScopeMap[d][e] = {}), this.shareScopeMap[d][e][l] || (this.shareScopeMap[d][e][l] = {
2035
+ d.forEach((f) => {
2036
+ this.shareScopeMap[f] || (this.shareScopeMap[f] = {}), this.shareScopeMap[f][e] || (this.shareScopeMap[f][e] = {}), this.shareScopeMap[f][e][l] || (this.shareScopeMap[f][e][l] = {
2037
2037
  version: l,
2038
- scope: [d],
2039
- ...f,
2038
+ scope: [f],
2039
+ ...u,
2040
2040
  lib: n
2041
2041
  });
2042
- const m = this.shareScopeMap[d][e][l];
2043
- u(m), r && m.from !== r && (m.from = r);
2042
+ const p = this.shareScopeMap[f][e][l];
2043
+ h(p), r && p.from !== r && (p.from = r);
2044
2044
  });
2045
2045
  }
2046
2046
  _setGlobalShareScopeMap(e) {
@@ -2089,18 +2089,18 @@ var En = class {
2089
2089
  async loadRemote(e, t) {
2090
2090
  const { host: r } = this;
2091
2091
  try {
2092
- const { loadFactory: n = !0 } = t || { loadFactory: !0 }, { module: o, moduleOptions: s, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: a, remote: l, expose: c, id: f, remoteSnapshot: h } = i, u = await o.get(f, c, t, h), d = await this.hooks.lifecycle.onLoad.emit({
2093
- id: f,
2092
+ const { loadFactory: n = !0 } = t || { loadFactory: !0 }, { module: o, moduleOptions: s, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: a, remote: l, expose: c, id: u, remoteSnapshot: d } = i, h = await o.get(u, c, t, d), f = await this.hooks.lifecycle.onLoad.emit({
2093
+ id: u,
2094
2094
  pkgNameOrAlias: a,
2095
2095
  expose: c,
2096
- exposeModule: n ? u : void 0,
2097
- exposeModuleFactory: n ? void 0 : u,
2096
+ exposeModule: n ? h : void 0,
2097
+ exposeModuleFactory: n ? void 0 : h,
2098
2098
  remote: l,
2099
2099
  options: s,
2100
2100
  moduleInstance: o,
2101
2101
  origin: r
2102
2102
  });
2103
- return this.setIdToRemoteMap(e, i), typeof d == "function" ? d : u;
2103
+ return this.setIdToRemoteMap(e, i), typeof f == "function" ? f : h;
2104
2104
  } catch (n) {
2105
2105
  const { from: o = "runtime" } = t || { from: "runtime" }, s = await this.hooks.lifecycle.errorLoadRemote.emit({
2106
2106
  id: e,
@@ -2148,18 +2148,18 @@ var En = class {
2148
2148
  options: t.options,
2149
2149
  origin: t
2150
2150
  });
2151
- } catch (d) {
2151
+ } catch (f) {
2152
2152
  if (n = await this.hooks.lifecycle.errorLoadRemote.emit({
2153
2153
  id: r,
2154
2154
  options: t.options,
2155
2155
  origin: t,
2156
2156
  from: "runtime",
2157
- error: d,
2157
+ error: f,
2158
2158
  lifecycle: "beforeRequest"
2159
- }), !n) throw d;
2159
+ }), !n) throw f;
2160
2160
  }
2161
2161
  const { id: o } = n, s = Zr(t.options.remotes, o);
2162
- s || S(Rt, O, {
2162
+ s || $(Rt, O, {
2163
2163
  hostName: t.options.name,
2164
2164
  requestId: o
2165
2165
  }, void 0, z(t.options));
@@ -2169,16 +2169,16 @@ var En = class {
2169
2169
  options: t.options,
2170
2170
  origin: t,
2171
2171
  remoteInfo: a
2172
- }), { remote: c, expose: f } = l;
2173
- P(c && f, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);
2174
- let h = t.moduleCache.get(c.name);
2175
- const u = {
2172
+ }), { remote: c, expose: u } = l;
2173
+ P(c && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);
2174
+ let d = t.moduleCache.get(c.name);
2175
+ const h = {
2176
2176
  host: t,
2177
2177
  remoteInfo: a
2178
2178
  };
2179
- return h || (h = new Pt(u), t.moduleCache.set(c.name, h)), {
2180
- module: h,
2181
- moduleOptions: u,
2179
+ return d || (d = new Pt(h), t.moduleCache.set(c.name, d)), {
2180
+ module: d,
2181
+ moduleOptions: h,
2182
2182
  remoteMatchInfo: l
2183
2183
  };
2184
2184
  }
@@ -2191,7 +2191,7 @@ var En = class {
2191
2191
  });
2192
2192
  P(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2193
2193
  }
2194
- "entry" in e && F && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = re), e.type || (e.type = pt);
2194
+ "entry" in e && F && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = re), e.type || (e.type = mt);
2195
2195
  };
2196
2196
  this.hooks.lifecycle.beforeRegisterRemote.emit({
2197
2197
  remote: e,
@@ -2221,46 +2221,46 @@ var En = class {
2221
2221
  const i = s.remoteInfo, a = i.entryGlobalName;
2222
2222
  I[a] && ((t = Object.getOwnPropertyDescriptor(I, a)) != null && t.configurable ? delete I[a] : I[a] = void 0);
2223
2223
  const l = Pe(s.remoteInfo);
2224
- B[l] && delete B[l], r.snapshotHandler.manifestCache.delete(i.entry);
2224
+ V[l] && delete V[l], r.snapshotHandler.manifestCache.delete(i.entry);
2225
2225
  let c = i.buildVersion ? Xe(i.name, i.buildVersion) : i.name;
2226
- const f = I.__FEDERATION__.__INSTANCES__.findIndex((u) => i.buildVersion ? u.options.id === c : u.name === c);
2227
- if (f !== -1) {
2228
- const u = I.__FEDERATION__.__INSTANCES__[f];
2229
- c = u.options.id || c;
2230
- const d = gt();
2231
- let m = !0;
2232
- const y = [];
2233
- Object.keys(d).forEach((g) => {
2234
- const p = d[g];
2235
- p && Object.keys(p).forEach((E) => {
2236
- const b = p[E];
2237
- b && Object.keys(b).forEach((N) => {
2238
- const _ = b[N];
2239
- _ && Object.keys(_).forEach(($) => {
2240
- const R = _[$];
2241
- R && typeof R == "object" && R.from === i.name && (R.loaded || R.loading ? (R.useIn = R.useIn.filter((w) => w !== i.name), R.useIn.length ? m = !1 : y.push([
2226
+ const u = I.__FEDERATION__.__INSTANCES__.findIndex((h) => i.buildVersion ? h.options.id === c : h.name === c);
2227
+ if (u !== -1) {
2228
+ const h = I.__FEDERATION__.__INSTANCES__[u];
2229
+ c = h.options.id || c;
2230
+ const f = gt();
2231
+ let p = !0;
2232
+ const m = [];
2233
+ Object.keys(f).forEach((g) => {
2234
+ const y = f[g];
2235
+ y && Object.keys(y).forEach((E) => {
2236
+ const b = y[E];
2237
+ b && Object.keys(b).forEach((S) => {
2238
+ const _ = b[S];
2239
+ _ && Object.keys(_).forEach((w) => {
2240
+ const R = _[w];
2241
+ R && typeof R == "object" && R.from === i.name && (R.loaded || R.loading ? (R.useIn = R.useIn.filter((N) => N !== i.name), R.useIn.length ? p = !1 : m.push([
2242
2242
  g,
2243
2243
  E,
2244
- N,
2245
- $
2246
- ])) : y.push([
2244
+ S,
2245
+ w
2246
+ ])) : m.push([
2247
2247
  g,
2248
2248
  E,
2249
- N,
2250
- $
2249
+ S,
2250
+ w
2251
2251
  ]));
2252
2252
  });
2253
2253
  });
2254
2254
  });
2255
- }), m && (u.shareScopeMap = {}, delete d[c]), y.forEach(([g, p, E, b]) => {
2256
- var N, _, $;
2257
- ($ = (_ = (N = d[g]) == null ? void 0 : N[p]) == null ? void 0 : _[E]) == null || delete $[b];
2258
- }), I.__FEDERATION__.__INSTANCES__.splice(f, 1);
2255
+ }), p && (h.shareScopeMap = {}, delete f[c]), m.forEach(([g, y, E, b]) => {
2256
+ var S, _, w;
2257
+ (w = (_ = (S = f[g]) == null ? void 0 : S[y]) == null ? void 0 : _[E]) == null || delete w[b];
2258
+ }), I.__FEDERATION__.__INSTANCES__.splice(u, 1);
2259
2259
  }
2260
- const { hostGlobalSnapshot: h } = Mt(e, r);
2261
- if (h) {
2262
- const u = h && "remotesInfo" in h && h.remotesInfo && q(h.remotesInfo, e.name).key;
2263
- u && (delete h.remotesInfo[u], Q.__FEDERATION__.__MANIFEST_LOADING__[u] && delete Q.__FEDERATION__.__MANIFEST_LOADING__[u]);
2260
+ const { hostGlobalSnapshot: d } = Mt(e, r);
2261
+ if (d) {
2262
+ const h = d && "remotesInfo" in d && d.remotesInfo && q(d.remotesInfo, e.name).key;
2263
+ h && (delete d.remotesInfo[h], Q.__FEDERATION__.__MANIFEST_LOADING__[h] && delete Q.__FEDERATION__.__MANIFEST_LOADING__[h]);
2264
2264
  }
2265
2265
  r.moduleCache.delete(e.name);
2266
2266
  }
@@ -2277,7 +2277,7 @@ var Sn = class {
2277
2277
  init: new v(),
2278
2278
  beforeInitContainer: new D("beforeInitContainer"),
2279
2279
  initContainer: new D("initContainer")
2280
- }), this.version = "2.3.1", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
2280
+ }), this.version = "2.3.2", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
2281
2281
  getModuleInfo: new v(),
2282
2282
  createScript: new v(),
2283
2283
  createLink: new v(),
@@ -2290,7 +2290,7 @@ var Sn = class {
2290
2290
  beforeBridgeDestroy: new v(),
2291
2291
  afterBridgeDestroy: new v()
2292
2292
  });
2293
- const t = Rn ? [mn(), gn()] : [], r = {
2293
+ const t = Rn ? [pn(), gn()] : [], r = {
2294
2294
  id: cn(),
2295
2295
  name: e.name,
2296
2296
  plugins: t,
@@ -2301,7 +2301,7 @@ var Sn = class {
2301
2301
  this.name = e.name, this.options = r, this.snapshotHandler = new En(this), this.sharedHandler = new _n(this), this.remoteHandler = new bn(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2302
2302
  }
2303
2303
  initOptions(e) {
2304
- e.name && e.name !== this.options.name && S(st(wt, O)), this.registerPlugins(e.plugins);
2304
+ e.name && e.name !== this.options.name && $(st(wt, O)), this.registerPlugins(e.plugins);
2305
2305
  const t = this.formatOptions(this.options, e);
2306
2306
  return this.options = t, t;
2307
2307
  }
@@ -2373,7 +2373,7 @@ let $n = null;
2373
2373
  function Ct() {
2374
2374
  return $n;
2375
2375
  }
2376
- mr(Sn);
2376
+ pr(Sn);
2377
2377
  function Dt(e, t) {
2378
2378
  const r = (n) => {
2379
2379
  const o = n.length > 1 && n.endsWith("/"), s = `${t}/${n}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
@@ -2394,46 +2394,50 @@ function Dt(e, t) {
2394
2394
  });
2395
2395
  }
2396
2396
  function wn(e) {
2397
+ const t = e.replace(/\/+$/, ""), r = (s) => s.startsWith("/") && s !== t && !s.startsWith(t + "/"), n = (s) => `${t}${s}`.replace(/\/+/g, "/"), o = (s) => typeof s == "string" ? r(s) ? n(s) : s : "path" in s && typeof s.path == "string" && r(s.path) ? { ...s, path: n(s.path) } : s;
2398
+ return (s) => {
2399
+ const i = s.push.bind(s), a = s.replace.bind(s), l = s.resolve.bind(s);
2400
+ s.push = (c) => i(o(c)), s.replace = (c) => a(o(c)), s.resolve = (c, ...u) => l(o(c), ...u);
2401
+ };
2402
+ }
2403
+ function Nn(e) {
2397
2404
  const { router: t, basename: r, memoryRoute: n, hashRoute: o } = e, s = t.getRoutes().sort(
2398
- (u, d) => u.path.split("/").filter((m) => m).length - d.path.split("/").filter((m) => m).length
2405
+ (f, p) => f.path.split("/").filter((m) => m).length - p.path.split("/").filter((m) => m).length
2399
2406
  ), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
2400
- s.forEach((u) => {
2401
- i.set(u.path, u);
2407
+ s.forEach((f) => {
2408
+ i.set(f.path, f);
2402
2409
  });
2403
- const l = (u, d) => `${u}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", c = (u, d = "") => {
2404
- if (!u.children || u.children.length === 0)
2405
- return u;
2406
- for (let m = 0; m < u.children.length; m++) {
2407
- const y = u.children[m], g = l(d, y.path), p = i.get(g);
2408
- if (p && !a.has(p)) {
2409
- const E = {
2410
- ...p,
2411
- path: y.path
2410
+ const l = (f, p) => `${f}/${p}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", c = (f, p = "") => {
2411
+ if (!f.children || f.children.length === 0)
2412
+ return f;
2413
+ for (let m = 0; m < f.children.length; m++) {
2414
+ const g = f.children[m], y = l(p, g.path), E = i.get(y);
2415
+ if (E && !a.has(E)) {
2416
+ const b = {
2417
+ ...E,
2418
+ path: g.path
2412
2419
  // Keep the original relative path from static route
2413
2420
  };
2414
- u.children[m] = E, a.add(p), c(E, g);
2421
+ f.children[m] = b, a.add(E), c(b, y);
2415
2422
  }
2416
2423
  }
2417
- return u;
2424
+ return f;
2418
2425
  };
2419
- let f = [];
2420
- for (const u of s)
2421
- if (!a.has(u)) {
2422
- const d = c(u, u.path);
2423
- a.add(u), f.push(d);
2426
+ let u = [];
2427
+ for (const f of s)
2428
+ if (!a.has(f)) {
2429
+ const p = c(f, f.path);
2430
+ a.add(f), u.push(p);
2424
2431
  }
2425
- let h;
2426
- return n ? h = ae.createMemoryHistory(r) : o ? (h = ae.createWebHashHistory(), r && (f = Dt(f, r))) : h = ae.createWebHistory(r), {
2427
- history: h,
2428
- routes: f
2429
- };
2432
+ let d, h;
2433
+ return n ? d = ae.createMemoryHistory(r) : o ? (d = ae.createWebHashHistory(), r && (u = Dt(u, r), h = wn(r))) : d = ae.createWebHistory(r), { history: d, routes: u, patchRouter: h };
2430
2434
  }
2431
- function Pn(e) {
2435
+ function kn(e) {
2432
2436
  const t = /* @__PURE__ */ new Map(), r = Ct();
2433
2437
  return () => ({
2434
- __APP_VERSION__: "2.3.1",
2438
+ __APP_VERSION__: "2.3.2",
2435
2439
  async render(n) {
2436
- var m, y, g;
2440
+ var p, m, g;
2437
2441
  C.debug("createBridgeComponent render Info", n);
2438
2442
  const {
2439
2443
  moduleName: o,
@@ -2442,33 +2446,33 @@ function Pn(e) {
2442
2446
  memoryRoute: a,
2443
2447
  hashRoute: l,
2444
2448
  ...c
2445
- } = n, f = Ft.createApp(e.rootComponent, c);
2446
- t.set(s, f);
2447
- const h = await ((g = (y = (m = r == null ? void 0 : r.bridgeHook) == null ? void 0 : m.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : g.emit(n)), u = h && typeof h == "object" && (h != null && h.extraProps) ? h == null ? void 0 : h.extraProps : {}, d = e.appOptions({
2448
- app: f,
2449
+ } = n, u = Ft.createApp(e.rootComponent, c);
2450
+ t.set(s, u);
2451
+ const d = await ((g = (m = (p = r == null ? void 0 : r.bridgeHook) == null ? void 0 : p.lifecycle) == null ? void 0 : m.beforeBridgeRender) == null ? void 0 : g.emit(n)), h = d && typeof d == "object" && (d != null && d.extraProps) ? d == null ? void 0 : d.extraProps : {}, f = e.appOptions({
2452
+ app: u,
2449
2453
  basename: i,
2450
2454
  memoryRoute: a,
2451
2455
  hashRoute: l,
2452
2456
  ...c,
2453
- ...u
2457
+ ...h
2454
2458
  });
2455
- if (d != null && d.router) {
2456
- const { history: p, routes: E } = wn({
2457
- router: d.router,
2459
+ if (f != null && f.router) {
2460
+ const { history: y, routes: E, patchRouter: b } = Nn({
2461
+ router: f.router,
2458
2462
  basename: n.basename,
2459
2463
  memoryRoute: n.memoryRoute,
2460
2464
  hashRoute: n.hashRoute
2461
- }), b = ae.createRouter({
2462
- ...d.router.options,
2463
- history: p,
2465
+ }), S = ae.createRouter({
2466
+ ...f.router.options,
2467
+ history: y,
2464
2468
  routes: E
2465
2469
  });
2466
- C.debug("createBridgeComponent render router info>>>", {
2470
+ b && b(S), f.afterRouterCreate && f.afterRouterCreate(S), C.debug("createBridgeComponent render router info>>>", {
2467
2471
  moduleName: o,
2468
- router: b
2469
- }), a && await b.push(a.entryPath), f.use(b);
2472
+ router: S
2473
+ }), a && await S.push(a.entryPath), u.use(S);
2470
2474
  }
2471
- f.mount(s);
2475
+ u.mount(s);
2472
2476
  },
2473
2477
  destroy(n) {
2474
2478
  C.debug("createBridgeComponent destroy Info", n);
@@ -2477,11 +2481,11 @@ function Pn(e) {
2477
2481
  }
2478
2482
  });
2479
2483
  }
2480
- function Nn() {
2484
+ function In() {
2481
2485
  const e = new PopStateEvent("popstate", { state: window.history.state });
2482
2486
  window.dispatchEvent(e);
2483
2487
  }
2484
- const In = /* @__PURE__ */ Ht({
2488
+ const Tn = /* @__PURE__ */ Ht({
2485
2489
  name: "RemoteApp",
2486
2490
  props: {
2487
2491
  moduleName: String,
@@ -2494,10 +2498,10 @@ const In = /* @__PURE__ */ Ht({
2494
2498
  inheritAttrs: !1,
2495
2499
  setup(e) {
2496
2500
  const t = ge(null), r = ge(null), n = ge(""), o = Ke(), s = Ct(), i = Gt(), a = async () => {
2497
- var u, d, m, y;
2498
- const c = (u = e.providerInfo) == null ? void 0 : u.call(e);
2501
+ var h, f, p, m;
2502
+ const c = (h = e.providerInfo) == null ? void 0 : h.call(e);
2499
2503
  r.value = c;
2500
- let f = {
2504
+ let u = {
2501
2505
  ...i,
2502
2506
  moduleName: e.moduleName,
2503
2507
  dom: t.value,
@@ -2505,35 +2509,35 @@ const In = /* @__PURE__ */ Ht({
2505
2509
  memoryRoute: e.memoryRoute,
2506
2510
  hashRoute: e.hashRoute
2507
2511
  };
2508
- C.debug("createRemoteAppComponent LazyComponent render >>>", f);
2509
- const h = await ((y = (m = (d = s == null ? void 0 : s.bridgeHook) == null ? void 0 : d.lifecycle) == null ? void 0 : m.beforeBridgeRender) == null ? void 0 : y.emit(f)) || {};
2510
- f = {
2511
- ...f,
2512
- ...h.extraProps
2513
- }, c.render(f);
2512
+ C.debug("createRemoteAppComponent LazyComponent render >>>", u);
2513
+ const d = await ((m = (p = (f = s == null ? void 0 : s.bridgeHook) == null ? void 0 : f.lifecycle) == null ? void 0 : p.beforeBridgeRender) == null ? void 0 : m.emit(u)) || {};
2514
+ u = {
2515
+ ...u,
2516
+ ...d.extraProps
2517
+ }, c.render(u);
2514
2518
  }, l = xt(() => o == null ? void 0 : o.path, (c) => {
2515
2519
  c !== o.path && a(), n.value !== "" && n.value !== c && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
2516
2520
  ...e,
2517
2521
  pathname: o.path
2518
- }), Nn()), n.value = c;
2522
+ }), In()), n.value = c;
2519
2523
  });
2520
2524
  return Ut(() => {
2521
2525
  a();
2522
- }), Vt(() => {
2526
+ }), Bt(() => {
2523
2527
  var c;
2524
2528
  C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
2525
2529
  ...e
2526
2530
  }), l(), (c = r.value) == null || c.destroy({
2527
2531
  dom: t.value
2528
2532
  });
2529
- }), () => Bt("div", Wt(e.rootAttrs || {}, {
2533
+ }), () => Vt("div", Wt(e.rootAttrs || {}, {
2530
2534
  ref: t
2531
2535
  }), null);
2532
2536
  }
2533
2537
  });
2534
- function Tn(e) {
2538
+ function vn(e) {
2535
2539
  return jt({
2536
- __APP_VERSION__: "2.3.1",
2540
+ __APP_VERSION__: "2.3.2",
2537
2541
  ...e.asyncComponentOptions,
2538
2542
  //@ts-ignore
2539
2543
  loader: async () => {
@@ -2557,7 +2561,7 @@ function Tn(e) {
2557
2561
  ), o in s && typeof a == "function")
2558
2562
  return {
2559
2563
  render() {
2560
- return qt(In, {
2564
+ return qt(Tn, {
2561
2565
  moduleName: i,
2562
2566
  providerInfo: a,
2563
2567
  basename: r,
@@ -2571,13 +2575,13 @@ function Tn(e) {
2571
2575
  }
2572
2576
  });
2573
2577
  }
2574
- function kn(e) {
2578
+ function On(e) {
2575
2579
  return C.warn(
2576
2580
  "createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
2577
- ), Tn(e);
2581
+ ), vn(e);
2578
2582
  }
2579
2583
  export {
2580
- Pn as createBridgeComponent,
2581
- Tn as createRemoteAppComponent,
2582
- kn as createRemoteComponent
2584
+ kn as createBridgeComponent,
2585
+ vn as createRemoteAppComponent,
2586
+ On as createRemoteComponent
2583
2587
  };