@module-federation/bridge-vue3 2.3.3 → 2.5.0

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,132 +1,117 @@
1
- import * as Ft from "vue";
2
- import { defineComponent as Ht, ref as Ee, 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
- import * as ae from "vue-router";
4
- import { useRoute as Ke } from "vue-router";
5
- const Kt = ".json", zt = "FEDERATION_DEBUG", Jt = ":";
6
- let we = /* @__PURE__ */ function(e) {
1
+ import * as jt from "vue";
2
+ import { defineComponent as qt, ref as _e, useAttrs as Kt, watch as zt, onMounted as Jt, onBeforeUnmount as Xt, createVNode as Yt, mergeProps as Zt, defineAsyncComponent as Qt, h as er } from "vue";
3
+ import * as le from "vue-router";
4
+ import { useRoute as Ze } from "vue-router";
5
+ const tr = ".json", rr = "FEDERATION_DEBUG", or = ":";
6
+ let Ne = /* @__PURE__ */ function(e) {
7
7
  return e[e.UNKNOWN = 1] = "UNKNOWN", e[e.CALCULATED = 2] = "CALCULATED", e[e.NO_USE = 0] = "NO_USE", e;
8
8
  }({});
9
- const F = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
10
- function ze() {
11
- return F;
9
+ const D = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
10
+ function Qe() {
11
+ return D;
12
12
  }
13
- function Je() {
13
+ function et() {
14
14
  return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
15
15
  }
16
- function Xt() {
16
+ function nr() {
17
17
  try {
18
- if (ze() && window.localStorage) return !!localStorage.getItem(zt);
18
+ if (Qe() && window.localStorage) return !!localStorage.getItem(rr);
19
19
  } catch {
20
20
  return !1;
21
21
  }
22
22
  return !1;
23
23
  }
24
- function Ne() {
25
- return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : Xt();
24
+ function Te() {
25
+ return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : nr();
26
26
  }
27
- const Yt = "[ Federation Runtime ]", Xe = function(...e) {
28
- return e.length ? e.reduce((t, r) => r ? t ? `${t}${Jt}${r}` : r : t, "") : "";
29
- }, Ie = (e, t) => {
27
+ const sr = "[ Federation Runtime ]", tt = function(...e) {
28
+ return e.length ? e.reduce((t, r) => r ? t ? `${t}${or}${r}` : r : t, "") : "";
29
+ }, ve = (e, t) => {
30
30
  if ("getPublicPath" in e) {
31
31
  let r;
32
32
  return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
33
- } else return "publicPath" in e ? !ze() && !Je() && "ssrPublicPath" in e && typeof e.ssrPublicPath == "string" ? `${e.ssrPublicPath}${t}` : `${e.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", e, t), "");
34
- }, Ye = (e) => {
35
- console.warn(`${Yt}: ${e}`);
33
+ } else return "publicPath" in e ? !Qe() && !et() && "ssrPublicPath" in e && typeof e.ssrPublicPath == "string" ? `${e.ssrPublicPath}${t}` : `${e.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", e, t), "");
34
+ }, rt = (e) => {
35
+ console.warn(`${sr}: ${e}`);
36
36
  };
37
- function Ze(e) {
37
+ function ot(e) {
38
38
  try {
39
39
  return JSON.stringify(e, null, 2);
40
40
  } catch {
41
41
  return "";
42
42
  }
43
43
  }
44
- const ne = (e, t) => {
44
+ const Re = (e, t) => {
45
45
  if (!e) return t;
46
- const n = ((o) => {
47
- if (o === ".") return "";
48
- if (o.startsWith("./")) return o.replace("./", "");
49
- if (o.startsWith("/")) {
50
- const s = o.slice(1);
46
+ const o = ((n) => {
47
+ if (n === ".") return "";
48
+ if (n.startsWith("./")) return n.replace("./", "");
49
+ if (n.startsWith("/")) {
50
+ const s = n.slice(1);
51
51
  return s.endsWith("/") ? s.slice(0, -1) : s;
52
52
  }
53
- return o;
53
+ return n;
54
54
  })(e);
55
- return n ? n.endsWith("/") ? `${n}${t}` : `${n}/${t}` : t;
55
+ return o ? o.endsWith("/") ? `${o}${t}` : `${o}/${t}` : t;
56
56
  };
57
- function Zt(e) {
57
+ function ir(e) {
58
58
  return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
59
59
  }
60
- function Qt(e, t = {}) {
61
- var _, b, R;
62
- const { remotes: r = {}, overrides: n = {}, version: o } = t;
60
+ function ar(e, t = {}) {
61
+ var _;
62
+ const { remotes: r = {}, overrides: o = {}, version: n } = t;
63
63
  let s;
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
- let l = {};
66
- Object.keys(r).length || (l = ((_ = e.remotes) == null ? void 0 : _.reduce((E, w) => {
67
- let S;
68
- const N = w.federationContainerName;
69
- return a.includes(N) ? S = n[N] : "version" in w ? S = w.version : S = w.entry, E[N] = { matchedVersion: S }, E;
70
- }, {})) || {}), Object.keys(r).forEach((E) => l[E] = { matchedVersion: a.includes(E) ? n[E] : r[E] });
71
- const { remoteEntry: { path: c, name: u, type: d }, types: h = {
64
+ const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && n ? ir(n) : e.metaData.publicPath : e.metaData.getPublicPath, c = Object.keys(o);
65
+ let a = {};
66
+ Object.keys(r).length || (a = ((_ = e.remotes) == null ? void 0 : _.reduce((g, R) => {
67
+ let w;
68
+ const $ = R.federationContainerName;
69
+ return c.includes($) ? w = o[$] : "version" in R ? w = R.version : w = R.entry, g[$] = { matchedVersion: w }, g;
70
+ }, {})) || {}), Object.keys(r).forEach((g) => a[g] = { matchedVersion: c.includes(g) ? o[g] : r[g] });
71
+ const { remoteEntry: { path: l, name: u, type: f }, types: d = {
72
72
  path: "",
73
73
  name: "",
74
74
  zip: "",
75
75
  api: ""
76
- }, buildInfo: { buildVersion: f }, globalName: p, ssrRemoteEntry: m } = e.metaData, { exposes: g } = e;
77
- let y = {
78
- version: o || "",
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
- remotesInfo: l,
87
- shared: e == null ? void 0 : e.shared.map((E) => ({
88
- assets: E.assets,
89
- sharedName: E.name,
90
- version: E.version,
91
- usedExports: E.referenceExports || []
76
+ }, buildInfo: { buildVersion: h }, globalName: m, ssrRemoteEntry: p } = e.metaData, { exposes: y } = e;
77
+ let E = {
78
+ version: n || "",
79
+ buildVersion: h,
80
+ globalName: m,
81
+ remoteEntry: Re(l, u),
82
+ remoteEntryType: f,
83
+ remoteTypes: Re(d.path, d.name),
84
+ remoteTypesZip: d.zip || "",
85
+ remoteTypesAPI: d.api || "",
86
+ remotesInfo: a,
87
+ shared: e == null ? void 0 : e.shared.map((g) => ({
88
+ assets: g.assets,
89
+ sharedName: g.name,
90
+ version: g.version,
91
+ usedExports: g.referenceExports || []
92
92
  })),
93
- modules: g == null ? void 0 : g.map((E) => ({
94
- moduleName: E.name,
95
- modulePath: E.path,
96
- assets: E.assets
93
+ modules: y == null ? void 0 : y.map((g) => ({
94
+ moduleName: g.name,
95
+ modulePath: g.path,
96
+ assets: g.assets
97
97
  }))
98
98
  };
99
- if ((b = e.metaData) != null && b.prefetchInterface) {
100
- const E = e.metaData.prefetchInterface;
101
- y = {
102
- ...y,
103
- prefetchInterface: E
104
- };
105
- }
106
- if ((R = e.metaData) != null && R.prefetchEntry) {
107
- const { path: E, name: w, type: S } = e.metaData.prefetchEntry;
108
- y = {
109
- ...y,
110
- prefetchEntry: ne(E, w),
111
- prefetchEntryType: S
112
- };
113
- }
114
99
  if ("publicPath" in e.metaData ? (s = {
115
- ...y,
100
+ ...E,
116
101
  publicPath: i()
117
102
  }, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
118
- ...y,
103
+ ...E,
119
104
  getPublicPath: i()
120
- }, m) {
121
- const E = ne(m.path, m.name);
122
- s.ssrRemoteEntry = E, s.ssrRemoteEntryType = m.type || "commonjs-module";
105
+ }, p) {
106
+ const g = Re(p.path, p.name);
107
+ s.ssrRemoteEntry = g, s.ssrRemoteEntryType = p.type || "commonjs-module";
123
108
  }
124
109
  return s;
125
110
  }
126
- function Qe(e) {
127
- return !!("remoteEntry" in e && e.remoteEntry.includes(Kt));
111
+ function nt(e) {
112
+ return !!("remoteEntry" in e && e.remoteEntry.includes(tr));
128
113
  }
129
- const er = "[ Module Federation ]", J = console, tr = [
114
+ const cr = "[ Module Federation ]", Y = console, lr = [
130
115
  "logger.ts",
131
116
  "logger.js",
132
117
  "captureStackTrace",
@@ -137,12 +122,12 @@ const er = "[ Module Federation ]", J = console, tr = [
137
122
  "Logger.error",
138
123
  "Logger.debug"
139
124
  ];
140
- function rr() {
125
+ function ur() {
141
126
  try {
142
127
  const e = (/* @__PURE__ */ new Error()).stack;
143
128
  if (!e) return;
144
129
  const [, ...t] = e.split(`
145
- `), r = t.filter((n) => !tr.some((o) => n.includes(o)));
130
+ `), r = t.filter((o) => !lr.some((n) => o.includes(n)));
146
131
  return r.length ? `Stack trace:
147
132
  ${r.slice(0, 5).join(`
148
133
  `)}` : void 0;
@@ -150,18 +135,18 @@ ${r.slice(0, 5).join(`
150
135
  return;
151
136
  }
152
137
  }
153
- var et = class {
154
- constructor(e, t = J) {
155
- this.prefix = e, this.delegate = t ?? J;
138
+ var st = class {
139
+ constructor(e, t = Y) {
140
+ this.prefix = e, this.delegate = t ?? Y;
156
141
  }
157
142
  setPrefix(e) {
158
143
  this.prefix = e;
159
144
  }
160
145
  setDelegate(e) {
161
- this.delegate = e ?? J;
146
+ this.delegate = e ?? Y;
162
147
  }
163
148
  emit(e, t) {
164
- const r = this.delegate, n = Ne() ? rr() : void 0, o = n ? [...t, n] : t, s = (() => {
149
+ const r = this.delegate, o = Te() ? ur() : void 0, n = o ? [...t, o] : t, s = (() => {
165
150
  switch (e) {
166
151
  case "log":
167
152
  return ["log", "info"];
@@ -184,16 +169,16 @@ var et = class {
184
169
  }
185
170
  })();
186
171
  for (const i of s) {
187
- const a = r[i];
188
- if (typeof a == "function") {
189
- a.call(r, this.prefix, ...o);
172
+ const c = r[i];
173
+ if (typeof c == "function") {
174
+ c.call(r, this.prefix, ...n);
190
175
  return;
191
176
  }
192
177
  }
193
178
  for (const i of s) {
194
- const a = J[i];
195
- if (typeof a == "function") {
196
- a.call(J, this.prefix, ...o);
179
+ const c = Y[i];
180
+ if (typeof c == "function") {
181
+ c.call(Y, this.prefix, ...n);
197
182
  return;
198
183
  }
199
184
  }
@@ -217,283 +202,299 @@ var et = class {
217
202
  this.emit("info", e);
218
203
  }
219
204
  debug(...e) {
220
- Ne() && this.emit("debug", e);
205
+ Te() && this.emit("debug", e);
221
206
  }
222
207
  };
223
- function tt(e) {
224
- return new et(e);
208
+ function it(e) {
209
+ return new st(e);
225
210
  }
226
- function nr(e) {
227
- const t = new et(e);
211
+ function fr(e) {
212
+ const t = new st(e);
228
213
  return Object.defineProperty(t, "__mf_infrastructure_logger__", {
229
214
  value: !0,
230
215
  enumerable: !1,
231
216
  configurable: !1
232
217
  }), t;
233
218
  }
234
- nr(er);
235
- async function rt(e, t) {
219
+ fr(cr);
220
+ async function at(e, t) {
236
221
  try {
237
222
  return await e();
238
223
  } catch (r) {
239
- Ye(r);
224
+ rt(r);
240
225
  return;
241
226
  }
242
227
  }
243
- function Te(e, t) {
228
+ function Ae(e, t) {
244
229
  const r = /^(https?:)?\/\//i;
245
230
  return e.replace(r, "").replace(/\/$/, "") === t.replace(r, "").replace(/\/$/, "");
246
231
  }
247
- function nt(e) {
248
- let t = null, r = !0, n = 2e4, o;
232
+ function ct(e) {
233
+ let t = null, r = !0, o = 2e4, n;
249
234
  const s = document.getElementsByTagName("script");
250
- for (let c = 0; c < s.length; c++) {
251
- const u = s[c], d = u.getAttribute("src");
252
- if (d && Te(d, e.url)) {
235
+ for (let l = 0; l < s.length; l++) {
236
+ const u = s[l], f = u.getAttribute("src");
237
+ if (f && Ae(f, e.url)) {
253
238
  t = u, r = !1;
254
239
  break;
255
240
  }
256
241
  }
257
242
  if (!t) {
258
- const c = e.attrs;
259
- t = document.createElement("script"), t.type = (c == null ? void 0 : c.type) === "module" ? "module" : "text/javascript";
243
+ const l = e.attrs;
244
+ t = document.createElement("script"), t.type = (l == null ? void 0 : l.type) === "module" ? "module" : "text/javascript";
260
245
  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]));
246
+ 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 && (o = u.timeout))), t.src || (t.src = e.url), l && !u && Object.keys(l).forEach((f) => {
247
+ t && (f === "async" || f === "defer" ? t[f] = l[f] : t.getAttribute(f) || t.setAttribute(f, l[f]));
263
248
  });
264
249
  }
265
250
  let i = null;
266
- const a = typeof window < "u" ? (c) => {
267
- if (c.filename && Te(c.filename, e.url)) {
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})`);
251
+ const c = typeof window < "u" ? (l) => {
252
+ if (l.filename && Ae(l.filename, e.url)) {
253
+ const u = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);
269
254
  u.name = "ScriptExecutionError", i = u;
270
255
  }
271
256
  } : null;
272
- a && window.addEventListener("error", a);
273
- const l = async (c, u) => {
274
- clearTimeout(o), a && window.removeEventListener("error", a);
275
- const d = () => {
257
+ c && window.addEventListener("error", c);
258
+ const a = async (l, u) => {
259
+ clearTimeout(n), c && window.removeEventListener("error", c);
260
+ const f = () => {
276
261
  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));
262
+ const d = /* @__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.)`);
263
+ d.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(d));
279
264
  } else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
280
265
  };
281
- if (t && (t.onerror = null, t.onload = null, rt(() => {
282
- const { needDeleteScript: h = !0 } = e;
283
- h && t != null && t.parentNode && t.parentNode.removeChild(t);
284
- }), c && typeof c == "function")) {
285
- const h = c(u);
286
- if (h instanceof Promise) {
287
- const f = await h;
288
- return d(), f;
266
+ if (t && (t.onerror = null, t.onload = null, at(() => {
267
+ const { needDeleteScript: d = !0 } = e;
268
+ d && t != null && t.parentNode && t.parentNode.removeChild(t);
269
+ }), l && typeof l == "function")) {
270
+ const d = l(u);
271
+ if (d instanceof Promise) {
272
+ const h = await d;
273
+ return f(), h;
289
274
  }
290
- return d(), h;
275
+ return f(), d;
291
276
  }
292
- d();
277
+ f();
293
278
  };
294
- return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), o = setTimeout(() => {
295
- l(null, {
279
+ return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), n = setTimeout(() => {
280
+ a(null, {
296
281
  type: "error",
297
282
  isTimeout: !0
298
283
  });
299
- }, n), {
284
+ }, o), {
300
285
  script: t,
301
286
  needAttach: r
302
287
  };
303
288
  }
304
- function _e(e) {
305
- let t = null, r = !0;
306
- const n = document.getElementsByTagName("link");
307
- for (let s = 0; s < n.length; s++) {
308
- const i = n[s], a = i.getAttribute("href"), l = i.getAttribute("rel");
309
- if (a && Te(a, e.url) && l === e.attrs.rel) {
310
- t = i, r = !1;
289
+ function hr(e) {
290
+ let t = null, r = !0, o = 2e4, n;
291
+ const s = document.getElementsByTagName("link");
292
+ for (let c = 0; c < s.length; c++) {
293
+ const a = s[c], l = a.getAttribute("href"), u = a.getAttribute("rel");
294
+ if (l && Ae(l, e.url) && u === e.attrs.rel) {
295
+ t = a, r = !1;
311
296
  break;
312
297
  }
313
298
  }
314
299
  if (!t) {
315
300
  t = document.createElement("link"), t.setAttribute("href", e.url);
316
- let s;
317
- const i = e.attrs;
318
- e.createLinkHook && (s = e.createLinkHook(e.url, i), s instanceof HTMLLinkElement && (t = s)), i && !s && Object.keys(i).forEach((a) => {
319
- t && !t.getAttribute(a) && t.setAttribute(a, i[a]);
301
+ let c, a = !0;
302
+ const l = e.attrs;
303
+ e.createLinkHook && (c = e.createLinkHook(e.url, l), c instanceof HTMLLinkElement ? (t = c, a = !1) : typeof c == "object" && ("link" in c && c.link && (t = c.link, a = !1), "timeout" in c && c.timeout && (o = c.timeout))), l && a && Object.keys(l).forEach((u) => {
304
+ t && !t.getAttribute(u) && t.setAttribute(u, l[u]);
320
305
  });
321
306
  }
322
- const o = (s, i) => {
323
- const a = () => {
324
- (i == null ? void 0 : i.type) === "error" ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
307
+ if (!r)
308
+ return Promise.resolve().then(() => {
309
+ e != null && e.cb && (e == null || e.cb());
310
+ }), {
311
+ link: t,
312
+ needAttach: r
313
+ };
314
+ const i = (c, a) => {
315
+ n && clearTimeout(n);
316
+ const l = () => {
317
+ if ((a == null ? void 0 : a.type) === "error") {
318
+ const u = /* @__PURE__ */ new Error(a != null && a.isTimeout ? `LinkNetworkError: Link "${e.url}" timed out.` : `LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);
319
+ u.name = "LinkNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
320
+ } else e != null && e.cb && (e == null || e.cb());
325
321
  };
326
- if (t && (t.onerror = null, t.onload = null, rt(() => {
327
- const { needDeleteLink: l = !0 } = e;
328
- l && t != null && t.parentNode && t.parentNode.removeChild(t);
329
- }), s)) {
330
- const l = s(i);
331
- return a(), l;
322
+ if (t && (t.onerror = null, t.onload = null, at(() => {
323
+ const { needDeleteLink: u = !0 } = e;
324
+ u && t != null && t.parentNode && t.parentNode.removeChild(t);
325
+ }), c)) {
326
+ const u = c(a);
327
+ return l(), u;
332
328
  }
333
- a();
329
+ l();
334
330
  };
335
- return t.onerror = o.bind(null, t.onerror), t.onload = o.bind(null, t.onload), {
331
+ return t.onerror = i.bind(null, t.onerror), t.onload = i.bind(null, t.onload), n = setTimeout(() => {
332
+ i(null, {
333
+ type: "error",
334
+ isTimeout: !0
335
+ });
336
+ }, o), {
336
337
  link: t,
337
338
  needAttach: r
338
339
  };
339
340
  }
340
- function or(e, t) {
341
- const { attrs: r = {}, createScriptHook: n } = t;
342
- return new Promise((o, s) => {
343
- const { script: i, needAttach: a } = nt({
341
+ function dr(e, t) {
342
+ const { attrs: r = {}, createScriptHook: o } = t;
343
+ return new Promise((n, s) => {
344
+ const { script: i, needAttach: c } = ct({
344
345
  url: e,
345
- cb: o,
346
+ cb: n,
346
347
  onErrorCallback: s,
347
348
  attrs: {
348
349
  fetchpriority: "high",
349
350
  ...r
350
351
  },
351
- createScriptHook: n,
352
+ createScriptHook: o,
352
353
  needDeleteScript: !0
353
354
  });
354
- a && document.head.appendChild(i);
355
+ c && document.head.appendChild(i);
355
356
  });
356
357
  }
357
- const oe = /* @__PURE__ */ new Map();
358
- function B(e) {
358
+ const ie = /* @__PURE__ */ new Map();
359
+ function W(e) {
359
360
  if (!e) throw new Error("import specifier is required");
360
- if (oe.has(e)) return oe.get(e);
361
+ if (ie.has(e)) return ie.get(e);
361
362
  const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
362
- throw console.error(`Error importing module ${e}:`, r), oe.delete(e), r;
363
+ throw console.error(`Error importing module ${e}:`, r), ie.delete(e), r;
363
364
  });
364
- return oe.set(e, t), t;
365
+ return ie.set(e, t), t;
365
366
  }
366
- const ot = async () => {
367
- const e = await B("node-fetch");
367
+ const lt = async () => {
368
+ const e = await W("node-fetch");
368
369
  return e.default || e;
369
- }, sr = async (e, t, r) => {
370
- const o = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
371
- return !o || !(o instanceof Response) ? (typeof fetch > "u" ? await ot() : fetch)(e, t || {}) : o;
372
- }, ir = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, n) => {
373
- if (n != null && n.createScriptHook) {
374
- const a = n.createScriptHook(e);
375
- a && typeof a == "object" && "url" in a && (e = a.url);
376
- }
377
- let o;
370
+ }, mr = async (e, t, r) => {
371
+ const n = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
372
+ return !n || !(n instanceof Response) ? (typeof fetch > "u" ? await lt() : fetch)(e, t || {}) : n;
373
+ }, pr = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, o) => {
374
+ if (o != null && o.createScriptHook) {
375
+ const c = o.createScriptHook(e);
376
+ c && typeof c == "object" && "url" in c && (e = c.url);
377
+ }
378
+ let n;
378
379
  try {
379
- o = new URL(e);
380
- } catch (a) {
381
- console.error("Error constructing URL:", a), t(/* @__PURE__ */ new Error(`Invalid URL: ${a}`));
380
+ n = new URL(e);
381
+ } catch (c) {
382
+ console.error("Error constructing URL:", c), t(/* @__PURE__ */ new Error(`Invalid URL: ${c}`));
382
383
  return;
383
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
- var c;
385
+ const s = async () => o != null && o.fetch ? (c, a) => mr(c, a, o) : typeof fetch > "u" ? lt() : fetch, i = async (c, a) => {
386
+ var l;
386
387
  try {
387
- const d = await (await a(l.href)).text(), [h, f] = await Promise.all([B("path"), B("vm")]), p = {
388
+ const f = await (await c(a.href)).text(), [d, h] = await Promise.all([W("path"), W("vm")]), m = {
388
389
  exports: {},
389
390
  module: { exports: {} }
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
+ }, p = a.pathname.split("/").slice(0, -1).join("/"), y = d.basename(a.pathname), E = new h.Script(`(function(exports, module, require, __dirname, __filename) {${f}
391
392
  })`, {
392
- filename: g,
393
- importModuleDynamically: ((c = f.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? B
393
+ filename: y,
394
+ importModuleDynamically: ((l = h.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? W
394
395
  });
395
396
  let _;
396
- _ = (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, _, m, g);
397
- const b = p.module.exports || p.exports;
398
- if (r && b && r.globalName) {
399
- t(void 0, b[r.globalName] || b);
397
+ _ = (await W("node:module")).createRequire(a.protocol === "file:" || a.protocol === "node:" ? a.href : d.join(process.cwd(), "__mf_require_base__.js")), E.runInThisContext()(m.exports, m.module, _, p, y);
398
+ const g = m.module.exports || m.exports;
399
+ if (r && g && r.globalName) {
400
+ t(void 0, g[r.globalName] || g);
400
401
  return;
401
402
  }
402
- t(void 0, b);
403
+ t(void 0, g);
403
404
  } catch (u) {
404
405
  t(u instanceof Error ? u : /* @__PURE__ */ new Error(`Script execution error: ${u}`));
405
406
  }
406
407
  };
407
- s().then(async (a) => {
408
- if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return ve(o.href, {
409
- fetch: a,
410
- vm: await B("vm")
411
- }).then(async (l) => {
412
- await l.evaluate(), t(void 0, l.namespace);
413
- }).catch((l) => {
414
- t(l instanceof Error ? l : /* @__PURE__ */ new Error(`Script execution error: ${l}`));
408
+ s().then(async (c) => {
409
+ if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return ke(n.href, {
410
+ fetch: c,
411
+ vm: await W("vm")
412
+ }).then(async (a) => {
413
+ await a.evaluate(), t(void 0, a.namespace);
414
+ }).catch((a) => {
415
+ t(a instanceof Error ? a : /* @__PURE__ */ new Error(`Script execution error: ${a}`));
415
416
  });
416
- i(a, o);
417
- }).catch((a) => {
418
- t(a);
417
+ i(c, n);
418
+ }).catch((c) => {
419
+ t(c);
419
420
  });
420
- } : (e, t, r, n) => {
421
+ } : (e, t, r, o) => {
421
422
  t(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));
422
- }, ar = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, n) => {
423
- ir(e, (o, s) => {
424
- var i, a;
425
- if (o) n(o);
423
+ }, yr = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, o) => {
424
+ pr(e, (n, s) => {
425
+ var i, c;
426
+ if (n) o(n);
426
427
  else {
427
- const l = ((i = t == null ? void 0 : t.attrs) == null ? void 0 : i.globalName) || `__FEDERATION_${(a = t == null ? void 0 : t.attrs) == null ? void 0 : a.name}:custom__`;
428
- r(globalThis[l] = s);
428
+ const a = ((i = t == null ? void 0 : t.attrs) == null ? void 0 : i.globalName) || `__FEDERATION_${(c = t == null ? void 0 : t.attrs) == null ? void 0 : c.name}:custom__`;
429
+ r(globalThis[a] = s);
429
430
  }
430
431
  }, t.attrs, t.loaderHook);
431
432
  }) : (e, t) => {
432
433
  throw new Error("loadScriptNode is disabled in non-Node.js environment");
433
434
  }, be = /* @__PURE__ */ new Map();
434
- async function ve(e, t) {
435
+ async function ke(e, t) {
435
436
  if (be.has(e)) return be.get(e);
436
- const { fetch: r, vm: n } = t, o = await (await r(e)).text(), s = new n.SourceTextModule(o, { importModuleDynamically: async (i, a) => {
437
- const l = new URL(i, e).href;
438
- return ve(l, t);
437
+ const { fetch: r, vm: o } = t, n = await (await r(e)).text(), s = new o.SourceTextModule(n, { importModuleDynamically: async (i, c) => {
438
+ const a = new URL(i, e).href;
439
+ return ke(a, t);
439
440
  } });
440
441
  return be.set(e, s), await s.link(async (i) => {
441
- const a = new URL(i, e).href;
442
- return await ve(a, t);
442
+ const c = new URL(i, e).href;
443
+ return await ke(c, t);
443
444
  }), s;
444
445
  }
445
- const C = tt("[ Module Federation Bridge Vue3 ]"), cr = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, st = (e, t, r, n) => {
446
- const o = [`${[t[e]]} #${e}`];
447
- return r && o.push(`args: ${JSON.stringify(r)}`), o.push(cr(e)), n && o.push(`Original Error Message:
448
- ${n}`), o.join(`
446
+ const C = it("[ Module Federation Bridge Vue3 ]"), Er = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, ut = (e, t, r, o) => {
447
+ const n = [`${[t[e]]} #${e}`];
448
+ return r && n.push(`args: ${JSON.stringify(r)}`), n.push(Er(e)), o && n.push(`Original Error Message:
449
+ ${o}`), n.join(`
449
450
  `);
450
451
  };
451
- function lr(e, t, r, n, o, s) {
452
- return n(st(e, t, r, o));
452
+ function gr(e, t, r, o, n, s) {
453
+ return o(ut(e, t, r, n));
453
454
  }
454
- const H = "[ Federation Runtime ]", Ae = tt(H);
455
- function P(e, t, r, n, o) {
456
- e || $(t);
455
+ const x = "[ Federation Runtime ]", Pe = it(x);
456
+ function O(e, t, r, o, n) {
457
+ e || b(t);
457
458
  }
458
- function $(e, t, r, n, o) {
459
- if (t !== void 0) return lr(e, t, r ?? {}, (i) => {
460
- throw new Error(`${H}: ${i}`);
461
- }, n);
459
+ function b(e, t, r, o, n) {
460
+ if (t !== void 0) return gr(e, t, r ?? {}, (i) => {
461
+ throw new Error(`${x}: ${i}`);
462
+ }, o);
462
463
  const s = e;
463
- throw s instanceof Error ? (s.message.startsWith(H) || (s.message = `${H}: ${s.message}`), s) : new Error(`${H}: ${s}`);
464
+ throw s instanceof Error ? (s.message.startsWith(x) || (s.message = `${x}: ${s.message}`), s) : new Error(`${x}: ${s}`);
464
465
  }
465
- function Oe(e) {
466
- e instanceof Error && (e.message.startsWith(H) || (e.message = `${H}: ${e.message}`)), Ae.warn(e);
466
+ function te(e) {
467
+ e instanceof Error && (e.message.startsWith(x) || (e.message = `${x}: ${e.message}`)), Pe.warn(e);
467
468
  }
468
- function ur(e, t) {
469
+ function _r(e, t) {
469
470
  return e.findIndex((r) => r === t) === -1 && e.push(t), e;
470
471
  }
471
- function Z(e) {
472
+ function ye(e) {
472
473
  return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
473
474
  }
474
- function Le(e) {
475
+ function Oe(e) {
475
476
  return typeof e.entry < "u";
476
477
  }
477
- function it(e) {
478
+ function ft(e) {
478
479
  return !e.entry.includes(".json");
479
480
  }
480
- function Me(e) {
481
+ function Ce(e) {
481
482
  return e && typeof e == "object";
482
483
  }
483
- const fr = Object.prototype.toString;
484
- function hr(e) {
485
- return fr.call(e) === "[object Object]";
484
+ const Rr = Object.prototype.toString;
485
+ function br(e) {
486
+ return Rr.call(e) === "[object Object]";
486
487
  }
487
- function at(e) {
488
+ function ht(e) {
488
489
  return Array.isArray(e) ? e : [e];
489
490
  }
490
- function ct(e) {
491
+ function dt(e) {
491
492
  const t = {
492
493
  url: "",
493
494
  type: "global",
494
495
  globalName: ""
495
496
  };
496
- return F || Je() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
497
+ return D || et() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
497
498
  url: e.remoteEntry,
498
499
  type: e.remoteEntryType,
499
500
  globalName: e.globalName
@@ -503,45 +504,45 @@ function ct(e) {
503
504
  globalName: e.globalName
504
505
  } : t;
505
506
  }
506
- const dr = (e, t) => {
507
+ const Sr = (e, t) => {
507
508
  let r;
508
509
  return e.endsWith("/") ? r = e.slice(0, -1) : r = e, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
509
- }, I = typeof globalThis == "object" ? globalThis : window, k = (() => {
510
+ }, N = typeof globalThis == "object" ? globalThis : window, P = (() => {
510
511
  try {
511
512
  return document.defaultView;
512
513
  } catch {
513
- return I;
514
+ return N;
514
515
  }
515
- })(), Q = k;
516
- function ce(e, t, r) {
516
+ })(), re = P;
517
+ function ue(e, t, r) {
517
518
  Object.defineProperty(e, t, {
518
519
  value: r,
519
520
  configurable: !1,
520
521
  writable: !0
521
522
  });
522
523
  }
523
- function le(e, t) {
524
+ function fe(e, t) {
524
525
  return Object.hasOwnProperty.call(e, t);
525
526
  }
526
- le(I, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ce(I, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
527
- const V = I.__GLOBAL_LOADING_REMOTE_ENTRY__;
528
- function lt(e) {
529
- var t, r, n, o, s, i;
530
- le(e, "__VMOK__") && !le(e, "__FEDERATION__") && ce(e, "__FEDERATION__", e.__VMOK__), le(e, "__FEDERATION__") || (ce(e, "__FEDERATION__", {
527
+ fe(N, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ue(N, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
528
+ const j = N.__GLOBAL_LOADING_REMOTE_ENTRY__;
529
+ function mt(e) {
530
+ var t, r, o, n, s, i;
531
+ fe(e, "__VMOK__") && !fe(e, "__FEDERATION__") && ue(e, "__FEDERATION__", e.__VMOK__), fe(e, "__FEDERATION__") || (ue(e, "__FEDERATION__", {
531
532
  __GLOBAL_PLUGIN__: [],
532
533
  __INSTANCES__: [],
533
534
  moduleInfo: {},
534
535
  __SHARE__: {},
535
536
  __MANIFEST_LOADING__: {},
536
537
  __PRELOADED_MAP__: /* @__PURE__ */ new Map()
537
- }), ce(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (n = e.__FEDERATION__).moduleInfo ?? (n.moduleInfo = {}), (o = e.__FEDERATION__).__SHARE__ ?? (o.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (i = e.__FEDERATION__).__PRELOADED_MAP__ ?? (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
538
+ }), ue(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (o = e.__FEDERATION__).moduleInfo ?? (o.moduleInfo = {}), (n = e.__FEDERATION__).__SHARE__ ?? (n.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (i = e.__FEDERATION__).__PRELOADED_MAP__ ?? (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
538
539
  }
539
- lt(I);
540
- lt(k);
541
- function pr(e, t = Ne()) {
542
- t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.3.3");
540
+ mt(N);
541
+ mt(P);
542
+ function wr(e, t = Te()) {
543
+ t && (N.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.5.0");
543
544
  }
544
- function q(e, t) {
545
+ function J(e, t) {
545
546
  if (typeof t == "string") {
546
547
  if (e[t]) return {
547
548
  value: e[t],
@@ -549,10 +550,10 @@ function q(e, t) {
549
550
  };
550
551
  {
551
552
  const r = Object.keys(e);
552
- for (const n of r) {
553
- const [o, s] = n.split(":"), i = `${o}:${t}`, a = e[i];
554
- if (a) return {
555
- value: a,
553
+ for (const o of r) {
554
+ const [n, s] = o.split(":"), i = `${n}:${t}`, c = e[i];
555
+ if (c) return {
556
+ value: c,
556
557
  key: i
557
558
  };
558
559
  }
@@ -561,180 +562,180 @@ function q(e, t) {
561
562
  key: t
562
563
  };
563
564
  }
564
- } else $(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
565
+ } else b(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
565
566
  }
566
- const Ge = () => k.__FEDERATION__.moduleInfo, mr = (e, t) => {
567
- const r = q(t, Z(e)).value;
567
+ const Ve = () => P.__FEDERATION__.moduleInfo, $r = (e, t) => {
568
+ const r = J(t, ye(e)).value;
568
569
  if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
569
570
  if ("version" in e && e.version) {
570
- const { version: n, ...o } = e, s = Z(o), i = q(k.__FEDERATION__.moduleInfo, s).value;
571
- if ((i == null ? void 0 : i.version) === n) return i;
572
- }
573
- }, ue = (e) => mr(e, k.__FEDERATION__.moduleInfo), xe = (e, t) => {
574
- const r = Z(e);
575
- return k.__FEDERATION__.moduleInfo[r] = t, k.__FEDERATION__.moduleInfo;
576
- }, yr = (e) => (k.__FEDERATION__.moduleInfo = {
577
- ...k.__FEDERATION__.moduleInfo,
571
+ const { version: o, ...n } = e, s = ye(n), i = J(P.__FEDERATION__.moduleInfo, s).value;
572
+ if ((i == null ? void 0 : i.version) === o) return i;
573
+ }
574
+ }, he = (e) => $r(e, P.__FEDERATION__.moduleInfo), We = (e, t) => {
575
+ const r = ye(e);
576
+ return P.__FEDERATION__.moduleInfo[r] = t, P.__FEDERATION__.moduleInfo;
577
+ }, Ir = (e) => (P.__FEDERATION__.moduleInfo = {
578
+ ...P.__FEDERATION__.moduleInfo,
578
579
  ...e
579
580
  }, () => {
580
581
  const t = Object.keys(e);
581
- for (const r of t) delete k.__FEDERATION__.moduleInfo[r];
582
- }), Ce = (e, t) => {
582
+ for (const r of t) delete P.__FEDERATION__.moduleInfo[r];
583
+ }), Fe = (e, t) => {
583
584
  const r = t || `__FEDERATION_${e}:custom__`;
584
585
  return {
585
586
  remoteEntryKey: r,
586
- entryExports: I[r]
587
+ entryExports: N[r]
587
588
  };
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})*))`, Re = `${Y}|x|X|\\*`, K = `[v=\\s]*(${Re})(?:\\.(${Re})(?:\\.(${Re})(?:${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
+ }, Nr = () => P.__FEDERATION__.__GLOBAL_PLUGIN__, Tr = (e) => N.__FEDERATION__.__PRELOADED_MAP__.get(e), vr = (e) => N.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), je = "[0-9A-Za-z-]+", He = `(?:\\+(${je}(?:\\.${je})*))`, ee = "0|[1-9]\\d*", de = "[0-9]+", pt = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", qe = `(?:${de}|${pt})`, Ar = `(?:-?(${qe}(?:\\.${qe})*))`, Ke = `(?:${ee}|${pt})`, yt = `(?:-(${Ke}(?:\\.${Ke})*))`, Se = `${ee}|x|X|\\*`, X = `[v=\\s]*(${Se})(?:\\.(${Se})(?:\\.(${Se})(?:${yt})?${He}?)?)?`, kr = `^\\s*(${X})\\s+-\\s+(${X})\\s*$`, Pr = `[v=\\s]*${`(${de})\\.(${de})\\.(${de})`}${Ar}?${He}?`, De = "((?:<|>)?=?)", Lr = `(\\s*)${De}\\s*(${Pr}|${X})`, Et = "(?:~>?)", Mr = `(\\s*)${Et}\\s+`, gt = "(?:\\^)", Or = `(\\s*)${gt}\\s+`, Cr = "(<|>)?=?\\s*\\*", Fr = `^${gt}${X}$`, Hr = `v?${`(${ee})\\.(${ee})\\.(${ee})`}${yt}?${He}?`, Dr = `^${Et}${X}$`, xr = `^${De}\\s*${X}$`, Gr = `^${De}\\s*(${Hr})$|^$`, Ur = "^\\s*>=\\s*0.0.0\\s*$";
589
590
  function M(e) {
590
591
  return new RegExp(e);
591
592
  }
592
593
  function T(e) {
593
594
  return !e || e.toLowerCase() === "x" || e === "*";
594
595
  }
595
- function pt(...e) {
596
- return (t) => e.reduce((r, n) => n(r), t);
596
+ function _t(...e) {
597
+ return (t) => e.reduce((r, o) => o(r), t);
597
598
  }
598
- function We(e) {
599
- return e.match(M(kr));
599
+ function ze(e) {
600
+ return e.match(M(Gr));
600
601
  }
601
- function je(e, t, r, n) {
602
- const o = `${e}.${t}.${r}`;
603
- return n ? `${o}-${n}` : o;
602
+ function Je(e, t, r, o) {
603
+ const n = `${e}.${t}.${r}`;
604
+ return o ? `${n}-${o}` : n;
604
605
  }
605
- function Lr(e) {
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()));
606
+ function Br(e) {
607
+ return e.replace(M(kr), (t, r, o, n, s, i, c, a, l, u, f, d) => (T(o) ? r = "" : T(n) ? r = `>=${o}.0.0` : T(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, T(l) ? a = "" : T(u) ? a = `<${Number(l) + 1}.0.0-0` : T(f) ? a = `<${l}.${Number(u) + 1}.0-0` : d ? a = `<=${l}.${u}.${f}-${d}` : a = `<=${a}`, `${r} ${a}`.trim()));
607
608
  }
608
- function Mr(e) {
609
- return e.replace(M($r), "$1$2$3");
609
+ function Vr(e) {
610
+ return e.replace(M(Lr), "$1$2$3");
610
611
  }
611
- function Cr(e) {
612
- return e.replace(M(wr), "$1~");
612
+ function Wr(e) {
613
+ return e.replace(M(Mr), "$1~");
613
614
  }
614
- function Dr(e) {
615
- return e.replace(M(Nr), "$1^");
615
+ function jr(e) {
616
+ return e.replace(M(Or), "$1^");
616
617
  }
617
- function Fr(e) {
618
- return e.trim().split(/\s+/).map((t) => t.replace(M(Tr), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? n === "0" ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.0 <${Number(n) + 1}.0.0-0` : i ? n === "0" ? o === "0" ? `>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s}-${i} <${Number(n) + 1}.0.0-0` : n === "0" ? o === "0" ? `>=${n}.${o}.${s} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${Number(n) + 1}.0.0-0`)).join(" ");
618
+ function qr(e) {
619
+ return e.trim().split(/\s+/).map((t) => t.replace(M(Fr), (r, o, n, s, i) => T(o) ? "" : T(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : T(s) ? o === "0" ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.0 <${Number(o) + 1}.0.0-0` : i ? o === "0" ? n === "0" ? `>=${o}.${n}.${s}-${i} <${o}.${n}.${Number(s) + 1}-0` : `>=${o}.${n}.${s}-${i} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s}-${i} <${Number(o) + 1}.0.0-0` : o === "0" ? n === "0" ? `>=${o}.${n}.${s} <${o}.${n}.${Number(s) + 1}-0` : `>=${o}.${n}.${s} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s} <${Number(o) + 1}.0.0-0`)).join(" ");
619
620
  }
620
- function Hr(e) {
621
- return e.trim().split(/\s+/).map((t) => t.replace(M(Ar), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : i ? `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0`)).join(" ");
621
+ function Kr(e) {
622
+ return e.trim().split(/\s+/).map((t) => t.replace(M(Dr), (r, o, n, s, i) => T(o) ? "" : T(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : T(s) ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : i ? `>=${o}.${n}.${s}-${i} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s} <${o}.${Number(n) + 1}.0-0`)).join(" ");
622
623
  }
623
- function Gr(e) {
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), 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;
624
+ function zr(e) {
625
+ return e.split(/\s+/).map((t) => t.trim().replace(M(xr), (r, o, n, s, i, c) => {
626
+ const a = T(n), l = a || T(s), u = l || T(i);
627
+ return o === "=" && u && (o = ""), c = "", a ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && u ? (l && (s = 0), i = 0, o === ">" ? (o = ">=", l ? (n = Number(n) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : o === "<=" && (o = "<", l ? n = Number(n) + 1 : s = Number(s) + 1), o === "<" && (c = "-0"), `${o + n}.${s}.${i}${c}`) : l ? `>=${n}.0.0${c} <${Number(n) + 1}.0.0-0` : u ? `>=${n}.${s}.0${c} <${n}.${Number(s) + 1}.0-0` : r;
627
628
  })).join(" ");
628
629
  }
629
- function xr(e) {
630
- return e.trim().replace(M(Ir), "");
630
+ function Jr(e) {
631
+ return e.trim().replace(M(Cr), "");
631
632
  }
632
- function Ur(e) {
633
- return e.trim().replace(M(Or), "");
633
+ function Xr(e) {
634
+ return e.trim().replace(M(Ur), "");
634
635
  }
635
- function he(e, t) {
636
+ function me(e, t) {
636
637
  return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
637
638
  }
638
- function Br(e, t) {
639
- const { preRelease: r } = e, { preRelease: n } = t;
640
- if (r === void 0 && n) return 1;
641
- if (r && n === void 0) return -1;
642
- if (r === void 0 && n === void 0) return 0;
643
- for (let o = 0, s = r.length; o <= s; o++) {
644
- const i = r[o], a = n[o];
645
- if (i !== a)
646
- return i === void 0 && a === void 0 ? 0 : i ? a ? he(i, a) : -1 : 1;
639
+ function Yr(e, t) {
640
+ const { preRelease: r } = e, { preRelease: o } = t;
641
+ if (r === void 0 && o) return 1;
642
+ if (r && o === void 0) return -1;
643
+ if (r === void 0 && o === void 0) return 0;
644
+ for (let n = 0, s = r.length; n <= s; n++) {
645
+ const i = r[n], c = o[n];
646
+ if (i !== c)
647
+ return i === void 0 && c === void 0 ? 0 : i ? c ? me(i, c) : -1 : 1;
647
648
  }
648
649
  return 0;
649
650
  }
650
- function se(e, t) {
651
- return he(e.major, t.major) || he(e.minor, t.minor) || he(e.patch, t.patch) || Br(e, t);
651
+ function ae(e, t) {
652
+ return me(e.major, t.major) || me(e.minor, t.minor) || me(e.patch, t.patch) || Yr(e, t);
652
653
  }
653
- function Se(e, t) {
654
+ function we(e, t) {
654
655
  return e.version === t.version;
655
656
  }
656
- function Vr(e, t) {
657
+ function Zr(e, t) {
657
658
  switch (e.operator) {
658
659
  case "":
659
660
  case "=":
660
- return Se(e, t);
661
+ return we(e, t);
661
662
  case ">":
662
- return se(e, t) < 0;
663
+ return ae(e, t) < 0;
663
664
  case ">=":
664
- return Se(e, t) || se(e, t) < 0;
665
+ return we(e, t) || ae(e, t) < 0;
665
666
  case "<":
666
- return se(e, t) > 0;
667
+ return ae(e, t) > 0;
667
668
  case "<=":
668
- return Se(e, t) || se(e, t) > 0;
669
+ return we(e, t) || ae(e, t) > 0;
669
670
  case void 0:
670
671
  return !0;
671
672
  default:
672
673
  return !1;
673
674
  }
674
675
  }
675
- function Wr(e) {
676
- return pt(Fr, Hr, Gr, xr)(e);
676
+ function Qr(e) {
677
+ return _t(qr, Kr, zr, Jr)(e);
677
678
  }
678
- function jr(e) {
679
- return pt(Lr, Mr, Cr, Dr)(e.trim()).split(/\s+/).join(" ");
679
+ function eo(e) {
680
+ return _t(Br, Vr, Wr, jr)(e.trim()).split(/\s+/).join(" ");
680
681
  }
681
- function X(e, t) {
682
+ function Q(e, t) {
682
683
  if (!e) return !1;
683
- const r = We(e);
684
+ const r = ze(e);
684
685
  if (!r) return !1;
685
- const [, n, , o, s, i, a] = r, l = {
686
- operator: n,
687
- version: je(o, s, i, a),
688
- major: o,
686
+ const [, o, , n, s, i, c] = r, a = {
687
+ operator: o,
688
+ version: Je(n, s, i, c),
689
+ major: n,
689
690
  minor: s,
690
691
  patch: i,
691
- preRelease: a == null ? void 0 : a.split(".")
692
- }, c = t.split("||");
693
- for (const u of c) {
694
- const d = u.trim();
695
- if (!d || d === "*" || d === "x") return !0;
692
+ preRelease: c == null ? void 0 : c.split(".")
693
+ }, l = t.split("||");
694
+ for (const u of l) {
695
+ const f = u.trim();
696
+ if (!f || f === "*" || f === "x") return !0;
696
697
  try {
697
- const h = jr(d);
698
+ const d = eo(f);
699
+ if (!d.trim()) return !0;
700
+ const h = d.split(" ").map((y) => Qr(y)).join(" ");
698
701
  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;
702
+ const m = h.split(/\s+/).map((y) => Xr(y)).filter(Boolean);
703
+ if (m.length === 0) continue;
704
+ let p = !0;
705
+ for (const y of m) {
706
+ const E = ze(y);
707
+ if (!E) {
708
+ p = !1;
708
709
  break;
709
710
  }
710
- const [, _, , b, R, E, w] = y;
711
- if (!Vr({
711
+ const [, _, , g, R, w, $] = E;
712
+ if (!Zr({
712
713
  operator: _,
713
- version: je(b, R, E, w),
714
- major: b,
714
+ version: Je(g, R, w, $),
715
+ major: g,
715
716
  minor: R,
716
- patch: E,
717
- preRelease: w == null ? void 0 : w.split(".")
718
- }, l)) {
719
- m = !1;
717
+ patch: w,
718
+ preRelease: $ == null ? void 0 : $.split(".")
719
+ }, a)) {
720
+ p = !1;
720
721
  break;
721
722
  }
722
723
  }
723
- if (m) return !0;
724
- } catch (h) {
725
- console.error(`[semver] Error processing range part "${d}":`, h);
724
+ if (p) return !0;
725
+ } catch (d) {
726
+ console.error(`[semver] Error processing range part "${f}":`, d);
726
727
  continue;
727
728
  }
728
729
  }
729
730
  return !1;
730
731
  }
731
- const re = "default", mt = "global";
732
- function qr(e, t, r, n) {
732
+ const se = "default", Rt = "global";
733
+ function to(e, t, r, o) {
733
734
  var s, i;
734
- let o;
735
- return "get" in e ? o = e.get : "lib" in e ? o = () => Promise.resolve(e.lib) : o = () => Promise.resolve(() => {
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.`), {
735
+ let n;
736
+ return "get" in e ? n = e.get : "lib" in e ? n = () => Promise.resolve(e.lib) : n = () => Promise.resolve(() => {
737
+ b(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
738
+ }), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && b(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
738
739
  deps: [],
739
740
  useIn: [],
740
741
  from: t,
@@ -747,201 +748,204 @@ function qr(e, t, r, n) {
747
748
  strictVersion: !1,
748
749
  ...e.shareConfig
749
750
  },
750
- get: o,
751
+ get: n,
751
752
  loaded: e != null && e.loaded || "lib" in e ? !0 : void 0,
752
753
  version: e.version ?? "0",
753
754
  scope: Array.isArray(e.scope) ? e.scope : [e.scope ?? "default"],
754
- strategy: (e.strategy ?? n) || "version-first",
755
+ strategy: (e.strategy ?? o) || "version-first",
755
756
  treeShaking: e.treeShaking ? {
756
757
  ...e.treeShaking,
757
758
  mode: e.treeShaking.mode ?? "server-calc",
758
- status: e.treeShaking.status ?? we.UNKNOWN,
759
+ status: e.treeShaking.status ?? Ne.UNKNOWN,
759
760
  useIn: []
760
761
  } : void 0
761
762
  };
762
763
  }
763
- function yt(e, t) {
764
- const r = t.shared || {}, n = t.name, o = Object.keys(r).reduce((i, a) => {
765
- const l = at(r[a]);
766
- return i[a] = i[a] || [], l.forEach((c) => {
767
- i[a].push(qr(c, n, a, t.shareStrategy));
764
+ function bt(e, t) {
765
+ const r = t.shared || {}, o = t.name, n = Object.keys(r).reduce((i, c) => {
766
+ const a = ht(r[c]);
767
+ return i[c] = i[c] || [], a.forEach((l) => {
768
+ i[c].push(to(l, o, c, t.shareStrategy));
768
769
  }), i;
769
770
  }, {}), s = { ...e.shared };
770
- return Object.keys(o).forEach((i) => {
771
- s[i] ? o[i].forEach((a) => {
772
- s[i].find((l) => l.version === a.version) || s[i].push(a);
773
- }) : s[i] = o[i];
771
+ return Object.keys(n).forEach((i) => {
772
+ s[i] ? n[i].forEach((c) => {
773
+ s[i].find((a) => a.version === c.version) || s[i].push(c);
774
+ }) : s[i] = n[i];
774
775
  }), {
775
776
  allShareInfos: s,
776
- newShareInfos: o
777
+ newShareInfos: n
777
778
  };
778
779
  }
779
- function ee(e, t) {
780
+ function oe(e, t) {
780
781
  if (!e) return !1;
781
- const { status: r, mode: n } = e;
782
- return r === we.NO_USE ? !1 : r === we.CALCULATED ? !0 : n === "runtime-infer" ? t ? zr(e, t) : !0 : !1;
782
+ const { status: r, mode: o } = e;
783
+ return r === Ne.NO_USE ? !1 : r === Ne.CALCULATED ? !0 : o === "runtime-infer" ? t ? oo(e, t) : !0 : !1;
783
784
  }
784
785
  function G(e, t) {
785
- const r = (n) => {
786
- if (!Number.isNaN(Number(n))) {
787
- const o = n.split(".");
788
- let s = n;
789
- for (let i = 0; i < 3 - o.length; i++) s += ".0";
786
+ const r = (o) => {
787
+ if (!Number.isNaN(Number(o))) {
788
+ const n = o.split(".");
789
+ let s = o;
790
+ for (let i = 0; i < 3 - n.length; i++) s += ".0";
790
791
  return s;
791
792
  }
792
- return n;
793
+ return o;
793
794
  };
794
- return !!X(r(e), `<=${r(t)}`);
795
+ return !!Q(r(e), `<=${r(t)}`);
795
796
  }
796
- const te = (e, t) => {
797
- const r = t || function(n, o) {
798
- return G(n, o);
797
+ const ne = (e, t) => {
798
+ const r = t || function(o, n) {
799
+ return G(o, n);
799
800
  };
800
- return Object.keys(e).reduce((n, o) => !n || r(n, o) || n === "0" ? o : n, 0);
801
- }, pe = (e) => !!e.loaded || typeof e.lib == "function", Kr = (e) => !!e.loading, zr = (e, t) => {
801
+ return Object.keys(e).reduce((o, n) => !o || r(o, n) || o === "0" ? n : o, 0);
802
+ }, Ee = (e) => !!e.loaded || typeof e.lib == "function", ro = (e) => !!e.loading, oo = (e, t) => {
802
803
  if (!e || !t) return !1;
803
804
  const { usedExports: r } = e;
804
- return r ? !!t.every((n) => r.includes(n)) : !1;
805
+ return r ? !!t.every((o) => r.includes(o)) : !1;
805
806
  };
806
- function Jr(e, t, r, n) {
807
- const o = e[t][r];
808
- let s = "", i = ee(n);
809
- const a = function(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);
807
+ function no(e, t, r, o) {
808
+ const n = e[t][r];
809
+ let s = "", i = oe(o);
810
+ const c = function(a, l) {
811
+ return i ? n[a].treeShaking ? n[l].treeShaking ? !Ee(n[a].treeShaking) && G(a, l) : !1 : !0 : !Ee(n[a]) && G(a, l);
811
812
  };
812
813
  if (i) {
813
- if (s = te(e[t][r], a), s) return {
814
+ if (s = ne(e[t][r], c), s) return {
814
815
  version: s,
815
816
  useTreesShaking: i
816
817
  };
817
818
  i = !1;
818
819
  }
819
820
  return {
820
- version: te(e[t][r], a),
821
+ version: ne(e[t][r], c),
821
822
  useTreesShaking: i
822
823
  };
823
824
  }
824
- const x = (e) => pe(e) || Kr(e);
825
- function Xr(e, t, r, n) {
826
- const o = e[t][r];
827
- let s = "", i = ee(n);
828
- const a = function(l, c) {
825
+ const B = (e) => Ee(e) || ro(e);
826
+ function so(e, t, r, o) {
827
+ const n = e[t][r];
828
+ let s = "", i = oe(o);
829
+ const c = function(a, l) {
829
830
  if (i) {
830
- if (!o[l].treeShaking) return !0;
831
- if (!o[c].treeShaking) return !1;
832
- if (x(o[c].treeShaking)) return x(o[l].treeShaking) ? !!G(l, c) : !0;
833
- if (x(o[l].treeShaking)) return !1;
831
+ if (!n[a].treeShaking) return !0;
832
+ if (!n[l].treeShaking) return !1;
833
+ if (B(n[l].treeShaking)) return B(n[a].treeShaking) ? !!G(a, l) : !0;
834
+ if (B(n[a].treeShaking)) return !1;
834
835
  }
835
- return x(o[c]) ? x(o[l]) ? !!G(l, c) : !0 : x(o[l]) ? !1 : G(l, c);
836
+ return B(n[l]) ? B(n[a]) ? !!G(a, l) : !0 : B(n[a]) ? !1 : G(a, l);
836
837
  };
837
838
  if (i) {
838
- if (s = te(e[t][r], a), s) return {
839
+ if (s = ne(e[t][r], c), s) return {
839
840
  version: s,
840
841
  useTreesShaking: i
841
842
  };
842
843
  i = !1;
843
844
  }
844
845
  return {
845
- version: te(e[t][r], a),
846
+ version: ne(e[t][r], c),
846
847
  useTreesShaking: i
847
848
  };
848
849
  }
849
- function Yr(e) {
850
- return e === "loaded-first" ? Xr : Jr;
850
+ function io(e) {
851
+ return e === "loaded-first" ? so : no;
851
852
  }
852
- function de(e, t, r, n) {
853
+ function pe(e, t, r, o) {
853
854
  if (!e) return;
854
- const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r, l = Array.isArray(s) ? s : [s];
855
- for (const c of l) if (o && e[c] && e[c][t]) {
856
- const { requiredVersion: u } = o, { version: d, useTreesShaking: h } = Yr(i)(e, c, t, a), f = () => {
857
- const m = e[c][t][d];
858
- if (o.singleton) {
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);
855
+ const { shareConfig: n, scope: s = se, strategy: i, treeShaking: c } = r, a = Array.isArray(s) ? s : [s];
856
+ for (const l of a) if (n && e[l] && e[l][t]) {
857
+ const { requiredVersion: u } = n, { version: f, useTreesShaking: d } = io(i)(e, l, t, c), h = () => {
858
+ const p = e[l][t][f];
859
+ if (n.singleton) {
860
+ if (typeof u == "string" && !Q(f, u)) {
861
+ const y = `Version ${f} from ${f && p.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
862
+ n.strictVersion ? b(y) : te(y);
862
863
  }
863
864
  return {
864
- shared: m,
865
- useTreesShaking: h
865
+ shared: p,
866
+ useTreesShaking: d
866
867
  };
867
868
  } else {
868
869
  if (u === !1 || u === "*") return {
869
- shared: m,
870
- useTreesShaking: h
870
+ shared: p,
871
+ useTreesShaking: d
871
872
  };
872
- if (X(d, u)) return {
873
- shared: m,
874
- useTreesShaking: h
873
+ if (Q(f, u)) return {
874
+ shared: p,
875
+ useTreesShaking: d
875
876
  };
876
- const g = ee(a);
877
- if (g) {
878
- for (const [y, _] of Object.entries(e[c][t]))
879
- if (ee(_.treeShaking, a == null ? void 0 : a.usedExports) && X(y, u))
877
+ const y = oe(c);
878
+ if (y) {
879
+ for (const [E, _] of Object.entries(e[l][t]))
880
+ if (oe(_.treeShaking, c == null ? void 0 : c.usedExports) && Q(E, u))
880
881
  return {
881
882
  shared: _,
882
- useTreesShaking: g
883
+ useTreesShaking: y
883
884
  };
884
885
  }
885
- for (const [y, _] of Object.entries(e[c][t])) if (X(y, u)) return {
886
+ for (const [E, _] of Object.entries(e[l][t])) if (Q(E, u)) return {
886
887
  shared: _,
887
888
  useTreesShaking: !1
888
889
  };
889
890
  }
890
- }, p = {
891
+ }, m = {
891
892
  shareScopeMap: e,
892
- scope: c,
893
+ scope: l,
893
894
  pkgName: t,
894
- version: d,
895
- GlobalFederation: Q.__FEDERATION__,
895
+ version: f,
896
+ GlobalFederation: re.__FEDERATION__,
896
897
  shareInfo: r,
897
- resolver: f
898
+ resolver: h
898
899
  };
899
- return (n.emit(p) || p).resolver();
900
+ return (o.emit(m) || m).resolver();
900
901
  }
901
902
  }
902
- function gt() {
903
- return Q.__FEDERATION__.__SHARE__;
903
+ function St() {
904
+ return re.__FEDERATION__.__SHARE__;
904
905
  }
905
- function qe(e) {
906
- const { pkgName: t, extraOptions: r, shareInfos: n } = e, o = (l) => {
907
- if (!l) return;
908
- const c = {};
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);
906
+ function Xe(e) {
907
+ const { pkgName: t, extraOptions: r, shareInfos: o } = e, n = (a) => {
908
+ if (!a) return;
909
+ const l = {};
910
+ return a.forEach((f) => {
911
+ l[f.version] = f;
912
+ }), l[ne(l, function(f, d) {
913
+ return !Ee(l[f]) && G(f, d);
913
914
  })];
914
- }, s = (r == null ? void 0 : r.resolver) ?? o, i = (l) => l !== null && typeof l == "object" && !Array.isArray(l), a = (...l) => {
915
- const c = {};
916
- for (const u of l)
915
+ }, s = (r == null ? void 0 : r.resolver) ?? n, i = (a) => a !== null && typeof a == "object" && !Array.isArray(a), c = (...a) => {
916
+ const l = {};
917
+ for (const u of a)
917
918
  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);
919
+ for (const [f, d] of Object.entries(u)) {
920
+ const h = l[f];
921
+ i(h) && i(d) ? l[f] = c(h, d) : d !== void 0 && (l[f] = d);
921
922
  }
922
- return c;
923
+ return l;
923
924
  };
924
- return a(s(n[t]), r == null ? void 0 : r.customShareInfo);
925
+ return c(s(o[t]), r == null ? void 0 : r.customShareInfo);
925
926
  }
926
- const U = (e, t) => {
927
- e.useIn || (e.useIn = []), ur(e.useIn, t);
927
+ const V = (e, t) => {
928
+ e.useIn || (e.useIn = []), _r(e.useIn, t);
928
929
  };
929
- function ie(e, t) {
930
+ function ce(e, t) {
930
931
  return t && e.treeShaking ? e.treeShaking : e;
931
932
  }
932
- function Zr(e, t) {
933
+ function xe(e, t) {
934
+ return !t || t === "." ? e : `${e}/${t.replace(/^\.\//, "")}`;
935
+ }
936
+ function Ye(e, t) {
933
937
  for (const r of e) {
934
- const n = t.startsWith(r.name);
935
- let o = t.replace(r.name, "");
936
- if (n) {
937
- if (o.startsWith("/")) {
938
- const a = r.name;
939
- return o = `.${o}`, {
940
- pkgNameOrAlias: a,
941
- expose: o,
938
+ const o = t.startsWith(r.name);
939
+ let n = t.replace(r.name, "");
940
+ if (o) {
941
+ if (n.startsWith("/")) {
942
+ const c = r.name;
943
+ return n = `.${n}`, {
944
+ pkgNameOrAlias: c,
945
+ expose: n,
942
946
  remote: r
943
947
  };
944
- } else if (o === "") return {
948
+ } else if (n === "") return {
945
949
  pkgNameOrAlias: r.name,
946
950
  expose: ".",
947
951
  remote: r
@@ -951,9 +955,9 @@ function Zr(e, t) {
951
955
  let i = r.alias && t.replace(r.alias, "");
952
956
  if (r.alias && s) {
953
957
  if (i && i.startsWith("/")) {
954
- const a = r.alias;
958
+ const c = r.alias;
955
959
  return i = `.${i}`, {
956
- pkgNameOrAlias: a,
960
+ pkgNameOrAlias: c,
957
961
  expose: i,
958
962
  remote: r
959
963
  };
@@ -965,183 +969,212 @@ function Zr(e, t) {
965
969
  }
966
970
  }
967
971
  }
968
- function Qr(e, t) {
972
+ function ao(e, t) {
969
973
  for (const r of e)
970
974
  if (t === r.name || r.alias && t === r.alias) return r;
971
975
  }
972
- const Et = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005", Pe = "RUNTIME-006", $t = "RUNTIME-007", He = "RUNTIME-008", en = "RUNTIME-009", wt = "RUNTIME-010", Nt = "RUNTIME-011", tn = "RUNTIME-012", O = {
973
- [Et]: "Failed to get remoteEntry exports.",
974
- [_t]: 'The remote entry interface does not contain "init"',
975
- [bt]: "Failed to get manifest.",
976
- [Rt]: "Failed to locate remote.",
977
- [St]: "Invalid loadShareSync function call from bundler runtime",
978
- [Pe]: "Invalid loadShareSync function call from runtime",
979
- [$t]: "Failed to get remote snapshot.",
980
- [He]: "Failed to load script resources.",
981
- [en]: "Please call createInstance first.",
982
- [wt]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
983
- [Nt]: "The remoteEntry URL is missing from the remote snapshot.",
984
- [tn]: 'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'
976
+ const wt = "RUNTIME-001", $t = "RUNTIME-002", It = "RUNTIME-003", Nt = "RUNTIME-004", Tt = "RUNTIME-005", Le = "RUNTIME-006", vt = "RUNTIME-007", Ge = "RUNTIME-008", co = "RUNTIME-009", At = "RUNTIME-010", kt = "RUNTIME-011", lo = "RUNTIME-012", Pt = "RUNTIME-013", Lt = "RUNTIME-014", Mt = "RUNTIME-015", k = {
977
+ [wt]: "Failed to get remoteEntry exports.",
978
+ [$t]: 'The remote entry interface does not contain "init"',
979
+ [It]: "Failed to get manifest.",
980
+ [Nt]: "Failed to locate remote.",
981
+ [Tt]: "Invalid loadShareSync function call from bundler runtime",
982
+ [Le]: "Invalid loadShareSync function call from runtime",
983
+ [vt]: "Failed to get remote snapshot.",
984
+ [Ge]: "Failed to load script resources.",
985
+ [co]: "Please call createInstance first.",
986
+ [At]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
987
+ [kt]: "The remoteEntry URL is missing from the remote snapshot.",
988
+ [lo]: 'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',
989
+ [Pt]: "The manifest is not a valid Module Federation manifest.",
990
+ [Lt]: "The remote does not expose the requested module.",
991
+ [Mt]: "Remote container initialization failed."
985
992
  };
986
993
  ({
987
- ...O
994
+ ...k
988
995
  });
989
- const It = ".then(callbacks[0]).catch(callbacks[1])";
990
- async function rn({ entry: e, remoteEntryExports: t }) {
991
- return new Promise((r, n) => {
996
+ const Ot = ".then(callbacks[0]).catch(callbacks[1])";
997
+ async function uo({ entry: e, remoteEntryExports: t }) {
998
+ return new Promise((r, o) => {
992
999
  try {
993
- t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${It}`)([r, n]) : import(
1000
+ t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${Ot}`)([r, o]) : import(
994
1001
  /* webpackIgnore: true */
995
1002
  /* @vite-ignore */
996
1003
  e
997
- ).then(r).catch(n);
998
- } catch (o) {
999
- $(`Failed to load ESM entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
1004
+ ).then(r).catch(o);
1005
+ } catch (n) {
1006
+ b(`Failed to load ESM entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
1000
1007
  }
1001
1008
  });
1002
1009
  }
1003
- async function nn({ entry: e, remoteEntryExports: t }) {
1004
- return new Promise((r, n) => {
1010
+ async function fo({ entry: e, remoteEntryExports: t }) {
1011
+ return new Promise((r, o) => {
1005
1012
  try {
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
- } catch (o) {
1008
- $(`Failed to load SystemJS entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
1013
+ t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(o) : new Function("callbacks", `System.import("${e}")${Ot}`)([r, o]);
1014
+ } catch (n) {
1015
+ b(`Failed to load SystemJS entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
1009
1016
  }
1010
1017
  });
1011
1018
  }
1012
- function Tt(e, t, r) {
1013
- const { remoteEntryKey: n, entryExports: o } = Ce(e, t);
1014
- return o || $(Et, O, {
1019
+ function Ct(e, t, r) {
1020
+ const { remoteEntryKey: o, entryExports: n } = Fe(e, t);
1021
+ return n || b(wt, k, {
1015
1022
  remoteName: e,
1016
1023
  remoteEntryUrl: r,
1017
- remoteEntryKey: n
1018
- }), o;
1024
+ remoteEntryKey: o
1025
+ }), n;
1019
1026
  }
1020
- async function on({ name: e, globalName: t, entry: r, remoteInfo: n, loaderHook: o, getEntryUrl: s }) {
1021
- const { entryExports: i } = Ce(e, t);
1022
- if (i) return i;
1027
+ async function ho({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook: n, getEntryUrl: s, resourceContext: i }) {
1028
+ const { entryExports: c } = Fe(e, t);
1029
+ if (c) return c;
1023
1030
  const a = s ? s(r) : r;
1024
- return or(a, {
1031
+ return dr(a, {
1025
1032
  attrs: {},
1026
- createScriptHook: (l, c) => {
1027
- const u = o.lifecycle.createScript.emit({
1033
+ createScriptHook: (l, u) => {
1034
+ const f = n.lifecycle.createScript.emit({
1028
1035
  url: l,
1029
- attrs: c,
1030
- remoteInfo: n
1036
+ attrs: u,
1037
+ remoteInfo: o,
1038
+ resourceContext: i ? {
1039
+ ...i,
1040
+ url: l
1041
+ } : void 0
1031
1042
  });
1032
- if (u && (u instanceof HTMLScriptElement || "script" in u || "timeout" in u))
1033
- return u;
1043
+ if (f && (f instanceof HTMLScriptElement || "script" in f || "timeout" in f))
1044
+ return f;
1034
1045
  }
1035
- }).then(() => Tt(e, t, r), (l) => {
1036
- const c = l instanceof Error ? l.message : String(l);
1037
- $(He, O, {
1046
+ }).then(() => Ct(e, t, r), (l) => {
1047
+ const u = l instanceof Error ? l.message : String(l);
1048
+ b(Ge, k, {
1038
1049
  remoteName: e,
1039
1050
  resourceUrl: a
1040
- }, c);
1051
+ }, u);
1041
1052
  });
1042
1053
  }
1043
- async function sn({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
1044
- const { entry: o, entryGlobalName: s, name: i, type: a } = e;
1054
+ async function mo({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: o, resourceContext: n }) {
1055
+ const { entry: s, entryGlobalName: i, name: c, type: a } = e;
1045
1056
  switch (a) {
1046
1057
  case "esm":
1047
1058
  case "module":
1048
- return rn({
1049
- entry: o,
1059
+ return uo({
1060
+ entry: s,
1050
1061
  remoteEntryExports: t
1051
1062
  });
1052
1063
  case "system":
1053
- return nn({
1054
- entry: o,
1064
+ return fo({
1065
+ entry: s,
1055
1066
  remoteEntryExports: t
1056
1067
  });
1057
1068
  default:
1058
- return on({
1059
- entry: o,
1060
- globalName: s,
1061
- name: i,
1069
+ return ho({
1070
+ entry: s,
1071
+ globalName: i,
1072
+ name: c,
1062
1073
  remoteInfo: e,
1063
1074
  loaderHook: r,
1064
- getEntryUrl: n
1075
+ getEntryUrl: o,
1076
+ resourceContext: n
1065
1077
  });
1066
1078
  }
1067
1079
  }
1068
- async function an({ remoteInfo: e, loaderHook: t }) {
1069
- const { entry: r, entryGlobalName: n, name: o, type: s } = e, { entryExports: i } = Ce(o, n);
1070
- return i || ar(r, {
1080
+ async function po({ remoteInfo: e, loaderHook: t, resourceContext: r }) {
1081
+ const { entry: o, entryGlobalName: n, name: s, type: i } = e, { entryExports: c } = Fe(s, n);
1082
+ return c || yr(o, {
1071
1083
  attrs: {
1072
- name: o,
1084
+ name: s,
1073
1085
  globalName: n,
1074
- type: s
1086
+ type: i
1075
1087
  },
1076
1088
  loaderHook: { createScriptHook: (a, l = {}) => {
1077
- const c = t.lifecycle.createScript.emit({
1089
+ const u = t.lifecycle.createScript.emit({
1078
1090
  url: a,
1079
1091
  attrs: l,
1080
- remoteInfo: e
1092
+ remoteInfo: e,
1093
+ resourceContext: r ? {
1094
+ ...r,
1095
+ url: a
1096
+ } : void 0
1081
1097
  });
1082
- if (c && "url" in c)
1083
- return c;
1098
+ if (u && "url" in u)
1099
+ return u;
1084
1100
  } }
1085
- }).then(() => Tt(o, n, r)).catch((a) => {
1086
- $(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error ? a.message : String(a)}`);
1101
+ }).then(() => Ct(s, n, o)).catch((a) => {
1102
+ b(`Failed to load Node.js entry for remote "${s}" from "${o}". ${a instanceof Error ? a.message : String(a)}`);
1087
1103
  });
1088
1104
  }
1089
- function ke(e) {
1105
+ function Me(e) {
1090
1106
  const { entry: t, name: r } = e;
1091
- return Xe(r, t);
1107
+ return tt(r, t);
1092
1108
  }
1093
- async function me(e) {
1094
- const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i = ke(n);
1109
+ async function Ue(e) {
1110
+ const { origin: t, remoteEntryExports: r, remoteInfo: o, getEntryUrl: n, resourceContext: s, _inErrorHandling: i = !1 } = e, c = Me(o);
1095
1111
  if (r) return r;
1096
- if (!V[i]) {
1112
+ if (!j[c]) {
1097
1113
  const a = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
1098
- V[i] = a.emit({
1114
+ j[c] = a.emit({
1115
+ origin: t,
1099
1116
  loaderHook: l,
1100
- remoteInfo: n,
1117
+ remoteInfo: o,
1101
1118
  remoteEntryExports: r
1102
- }).then((c) => c || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : F) ? sn({
1103
- remoteInfo: n,
1119
+ }).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : D) ? mo({
1120
+ remoteInfo: o,
1104
1121
  remoteEntryExports: r,
1105
1122
  loaderHook: l,
1106
- getEntryUrl: o
1107
- }) : an({
1108
- remoteInfo: n,
1109
- loaderHook: l
1110
- }))).catch(async (c) => {
1111
- const u = ke(n), d = c instanceof Error && c.message.includes("ScriptExecutionError");
1112
- if (c instanceof Error && c.message.includes(He) && !d && !s) {
1113
- const h = (p) => me({
1123
+ getEntryUrl: n,
1124
+ resourceContext: s
1125
+ }) : po({
1126
+ remoteInfo: o,
1127
+ loaderHook: l,
1128
+ resourceContext: s
1129
+ }))).then(async (u) => (await t.loaderHook.lifecycle.afterLoadEntry.emit({
1130
+ origin: t,
1131
+ remoteInfo: o,
1132
+ remoteEntryExports: u
1133
+ }), u)).catch(async (u) => {
1134
+ const f = Me(o), d = u instanceof Error && u.message.includes("ScriptExecutionError");
1135
+ if (u instanceof Error && u.message.includes(Ge) && !d && !i) {
1136
+ const h = (p) => Ue({
1114
1137
  ...p,
1115
1138
  _inErrorHandling: !0
1116
- }), f = await t.loaderHook.lifecycle.loadEntryError.emit({
1139
+ }), m = await t.loaderHook.lifecycle.loadEntryError.emit({
1117
1140
  getRemoteEntry: h,
1118
1141
  origin: t,
1119
- remoteInfo: n,
1142
+ remoteInfo: o,
1120
1143
  remoteEntryExports: r,
1121
- globalLoading: V,
1122
- uniqueKey: u
1144
+ globalLoading: j,
1145
+ uniqueKey: f
1123
1146
  });
1124
- if (f) return f;
1147
+ if (m)
1148
+ return await t.loaderHook.lifecycle.afterLoadEntry.emit({
1149
+ origin: t,
1150
+ remoteInfo: o,
1151
+ remoteEntryExports: m,
1152
+ recovered: !0
1153
+ }), m;
1125
1154
  }
1126
- throw c;
1155
+ throw await t.loaderHook.lifecycle.afterLoadEntry.emit({
1156
+ origin: t,
1157
+ remoteInfo: o,
1158
+ error: u
1159
+ }), u;
1127
1160
  });
1128
1161
  }
1129
- return V[i];
1162
+ return j[c];
1130
1163
  }
1131
- function ye(e) {
1164
+ function q(e) {
1132
1165
  return {
1133
1166
  ...e,
1134
1167
  entry: "entry" in e ? e.entry : "",
1135
- type: e.type || mt,
1168
+ type: e.type || Rt,
1136
1169
  entryGlobalName: e.entryGlobalName || e.name,
1137
- shareScope: e.shareScope || re
1170
+ shareScope: e.shareScope || se
1138
1171
  };
1139
1172
  }
1140
- function cn() {
1173
+ function yo() {
1141
1174
  return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
1142
1175
  }
1143
- function ln(e, t) {
1144
- const r = gr(), n = [
1176
+ function Eo(e, t) {
1177
+ const r = Nr(), o = [
1145
1178
  t.hooks,
1146
1179
  t.remoteHandler.hooks,
1147
1180
  t.sharedHandler.hooks,
@@ -1149,15 +1182,15 @@ function ln(e, t) {
1149
1182
  t.loaderHook,
1150
1183
  t.bridgeHook
1151
1184
  ];
1152
- return r.length > 0 && r.forEach((o) => {
1153
- e != null && e.find((s) => s.name !== o.name) && e.push(o);
1154
- }), e && e.length > 0 && e.forEach((o) => {
1155
- n.forEach((s) => {
1156
- s.applyPlugin(o, t);
1185
+ return r.length > 0 && r.forEach((n) => {
1186
+ e != null && e.find((s) => s.name !== n.name) && e.push(n);
1187
+ }), e && e.length > 0 && e.forEach((n) => {
1188
+ o.forEach((s) => {
1189
+ s.applyPlugin(n, t);
1157
1190
  });
1158
1191
  }), e;
1159
1192
  }
1160
- function un(e) {
1193
+ function go(e) {
1161
1194
  return {
1162
1195
  name: e.name,
1163
1196
  alias: e.alias,
@@ -1168,15 +1201,15 @@ function un(e) {
1168
1201
  shareScope: e.shareScope
1169
1202
  };
1170
1203
  }
1171
- function z(e) {
1172
- var r, n, o, s, i, a;
1204
+ function F(e) {
1205
+ var r, o, n, s, i, c;
1173
1206
  const t = {};
1174
- for (const [l, c] of Object.entries(e.shared)) {
1175
- const u = c[0];
1176
- u && (t[l] = {
1207
+ for (const [a, l] of Object.entries(e.shared)) {
1208
+ const u = l[0];
1209
+ u && (t[a] = {
1177
1210
  version: u.version,
1178
1211
  singleton: (r = u.shareConfig) == null ? void 0 : r.singleton,
1179
- requiredVersion: ((n = u.shareConfig) == null ? void 0 : n.requiredVersion) === !1 ? !1 : (o = u.shareConfig) == null ? void 0 : o.requiredVersion,
1212
+ requiredVersion: ((o = u.shareConfig) == null ? void 0 : o.requiredVersion) === !1 ? !1 : (n = u.shareConfig) == null ? void 0 : n.requiredVersion,
1180
1213
  eager: u.eager,
1181
1214
  strictVersion: (s = u.shareConfig) == null ? void 0 : s.strictVersion
1182
1215
  });
@@ -1188,194 +1221,306 @@ function z(e) {
1188
1221
  },
1189
1222
  mfConfig: {
1190
1223
  name: e.name,
1191
- remotes: ((a = e.remotes) == null ? void 0 : a.map(un)) ?? [],
1224
+ remotes: ((c = e.remotes) == null ? void 0 : c.map(go)) ?? [],
1192
1225
  shared: t
1193
1226
  }
1194
1227
  };
1195
1228
  }
1196
- function vt(e) {
1229
+ function Ft(e) {
1197
1230
  return {
1198
1231
  resourceCategory: "sync",
1199
1232
  share: !0,
1200
1233
  depsRemote: !0,
1201
- prefetchInterface: !1,
1202
1234
  ...e
1203
1235
  };
1204
1236
  }
1205
- function fn(e, t) {
1237
+ function _o(e, t) {
1206
1238
  return t.map((r) => {
1207
- const n = Qr(e, r.nameOrAlias);
1208
- return P(n, `Unable to preload ${r.nameOrAlias} as it is not included in ${!n && Ze({
1209
- remoteInfo: n,
1239
+ const o = ao(e, r.nameOrAlias);
1240
+ return O(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && ot({
1241
+ remoteInfo: o,
1210
1242
  remotes: e
1211
1243
  })}`), {
1212
- remote: n,
1213
- preloadConfig: vt(r)
1244
+ remote: o,
1245
+ preloadConfig: Ft(r)
1214
1246
  };
1215
1247
  });
1216
1248
  }
1217
- function hn(e) {
1249
+ function Ro(e) {
1218
1250
  return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
1219
1251
  }
1220
- function At(e, t, r, n = !0) {
1221
- const { cssAssets: o, jsAssetsWithoutEntry: s, entryAssets: i } = r;
1252
+ function Be(e) {
1253
+ return e instanceof Error ? e.message.includes("timed out") || e.name.includes("Timeout") : !1;
1254
+ }
1255
+ function U(e, t, r, o) {
1256
+ return {
1257
+ url: t,
1258
+ status: r,
1259
+ resourceType: e.resourceType,
1260
+ initiator: e.initiator,
1261
+ id: e.id,
1262
+ error: o
1263
+ };
1264
+ }
1265
+ async function bo(e, t, r, o) {
1266
+ const n = e.moduleCache.get(r.name), s = r.entry;
1267
+ if (n != null && n.remoteEntryExports) return U(o, s, "cached");
1268
+ try {
1269
+ if (!await Ue({
1270
+ origin: e,
1271
+ remoteInfo: r,
1272
+ remoteEntryExports: n == null ? void 0 : n.remoteEntryExports,
1273
+ resourceContext: {
1274
+ ...o,
1275
+ url: s
1276
+ }
1277
+ })) throw new Error(`Failed to load remoteEntry "${s}".`);
1278
+ return U(o, s, "success");
1279
+ } catch (i) {
1280
+ return U(o, s, Be(i) ? "timeout" : "error", i);
1281
+ }
1282
+ }
1283
+ function $e({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLink: s }) {
1284
+ return new Promise((i) => {
1285
+ const { link: c, needAttach: a } = hr({
1286
+ url: r,
1287
+ cb: () => {
1288
+ i(U(n, r, a ? "success" : "cached"));
1289
+ },
1290
+ onErrorCallback: (l) => {
1291
+ i(U(n, r, Be(l) ? "timeout" : "error", l));
1292
+ },
1293
+ attrs: o,
1294
+ createLinkHook: (l, u) => {
1295
+ const f = e.loaderHook.lifecycle.createLink.emit({
1296
+ url: l,
1297
+ attrs: u,
1298
+ remoteInfo: t,
1299
+ resourceContext: {
1300
+ ...n,
1301
+ url: l
1302
+ }
1303
+ });
1304
+ return f instanceof HTMLLinkElement, f;
1305
+ },
1306
+ needDeleteLink: s
1307
+ });
1308
+ a && document.head.appendChild(c);
1309
+ });
1310
+ }
1311
+ function So({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
1312
+ return new Promise((s) => {
1313
+ const { script: i, needAttach: c } = ct({
1314
+ url: r,
1315
+ cb: () => {
1316
+ s(U(n, r, c ? "success" : "cached"));
1317
+ },
1318
+ onErrorCallback: (a) => {
1319
+ s(U(n, r, Be(a) ? "timeout" : "error", a));
1320
+ },
1321
+ attrs: o,
1322
+ createScriptHook: (a, l) => {
1323
+ const u = e.loaderHook.lifecycle.createScript.emit({
1324
+ url: a,
1325
+ attrs: l,
1326
+ remoteInfo: t,
1327
+ resourceContext: {
1328
+ ...n,
1329
+ url: a
1330
+ }
1331
+ });
1332
+ return u instanceof HTMLScriptElement, u;
1333
+ },
1334
+ needDeleteScript: !0
1335
+ });
1336
+ c && document.head.appendChild(i);
1337
+ });
1338
+ }
1339
+ function Z(e, t) {
1340
+ return {
1341
+ ...e,
1342
+ resourceType: t
1343
+ };
1344
+ }
1345
+ function Ht(e, t, r, o = !0, n = {
1346
+ initiator: "preloadRemote",
1347
+ id: e.name
1348
+ }) {
1349
+ const { cssAssets: s, jsAssetsWithoutEntry: i, entryAssets: c } = r, a = [];
1222
1350
  if (t.options.inBrowser) {
1223
- if (i.forEach((a) => {
1224
- const { moduleInfo: l } = a, c = t.moduleCache.get(e.name);
1225
- me(c ? {
1226
- origin: t,
1227
- remoteInfo: l,
1228
- remoteEntryExports: c.remoteEntryExports
1229
- } : {
1230
- origin: t,
1231
- remoteInfo: l,
1232
- remoteEntryExports: void 0
1233
- });
1234
- }), n) {
1235
- const a = {
1351
+ if (c.forEach((l) => {
1352
+ const { moduleInfo: u } = l;
1353
+ a.push(bo(t, e, u, Z(n, "remoteEntry")));
1354
+ }), o) {
1355
+ const l = {
1236
1356
  rel: "preload",
1237
1357
  as: "style"
1238
1358
  };
1239
- o.forEach((l) => {
1240
- const { link: c, needAttach: u } = _e({
1241
- url: l,
1242
- cb: () => {
1243
- },
1244
- attrs: a,
1245
- createLinkHook: (d, h) => {
1246
- const f = t.loaderHook.lifecycle.createLink.emit({
1247
- url: d,
1248
- attrs: h,
1249
- remoteInfo: e
1250
- });
1251
- if (f instanceof HTMLLinkElement) return f;
1252
- }
1253
- });
1254
- u && document.head.appendChild(c);
1359
+ s.forEach((u) => {
1360
+ a.push($e({
1361
+ host: t,
1362
+ remoteInfo: e,
1363
+ url: u,
1364
+ attrs: l,
1365
+ context: Z(n, "css")
1366
+ }));
1255
1367
  });
1256
1368
  } else {
1257
- const a = {
1369
+ const l = {
1258
1370
  rel: "stylesheet",
1259
1371
  type: "text/css"
1260
1372
  };
1261
- o.forEach((l) => {
1262
- const { link: c, needAttach: u } = _e({
1263
- url: l,
1264
- cb: () => {
1265
- },
1266
- attrs: a,
1267
- createLinkHook: (d, h) => {
1268
- const f = t.loaderHook.lifecycle.createLink.emit({
1269
- url: d,
1270
- attrs: h,
1271
- remoteInfo: e
1272
- });
1273
- if (f instanceof HTMLLinkElement) return f;
1274
- },
1275
- needDeleteLink: !1
1276
- });
1277
- u && document.head.appendChild(c);
1373
+ s.forEach((u) => {
1374
+ a.push($e({
1375
+ host: t,
1376
+ remoteInfo: e,
1377
+ url: u,
1378
+ attrs: l,
1379
+ needDeleteLink: !1,
1380
+ context: Z(n, "css")
1381
+ }));
1278
1382
  });
1279
1383
  }
1280
- if (n) {
1281
- const a = {
1384
+ if (o) {
1385
+ const l = {
1282
1386
  rel: "preload",
1283
1387
  as: "script"
1284
1388
  };
1285
- s.forEach((l) => {
1286
- const { link: c, needAttach: u } = _e({
1287
- url: l,
1288
- cb: () => {
1289
- },
1290
- attrs: a,
1291
- createLinkHook: (d, h) => {
1292
- const f = t.loaderHook.lifecycle.createLink.emit({
1293
- url: d,
1294
- attrs: h,
1295
- remoteInfo: e
1296
- });
1297
- if (f instanceof HTMLLinkElement) return f;
1298
- }
1299
- });
1300
- u && document.head.appendChild(c);
1389
+ i.forEach((u) => {
1390
+ a.push($e({
1391
+ host: t,
1392
+ remoteInfo: e,
1393
+ url: u,
1394
+ attrs: l,
1395
+ context: Z(n, "js")
1396
+ }));
1301
1397
  });
1302
1398
  } else {
1303
- const a = {
1399
+ const l = {
1304
1400
  fetchpriority: "high",
1305
1401
  type: (e == null ? void 0 : e.type) === "module" ? "module" : "text/javascript"
1306
1402
  };
1307
- s.forEach((l) => {
1308
- const { script: c, needAttach: u } = nt({
1309
- url: l,
1310
- cb: () => {
1311
- },
1312
- attrs: a,
1313
- createScriptHook: (d, h) => {
1314
- const f = t.loaderHook.lifecycle.createScript.emit({
1315
- url: d,
1316
- attrs: h,
1317
- remoteInfo: e
1318
- });
1319
- if (f instanceof HTMLScriptElement) return f;
1320
- },
1321
- needDeleteScript: !0
1322
- });
1323
- u && document.head.appendChild(c);
1403
+ i.forEach((u) => {
1404
+ a.push(So({
1405
+ host: t,
1406
+ remoteInfo: e,
1407
+ url: u,
1408
+ attrs: l,
1409
+ context: Z(n, "js")
1410
+ }));
1324
1411
  });
1325
1412
  }
1326
1413
  }
1414
+ return Promise.all(a);
1327
1415
  }
1328
- function dn(e, t, r) {
1329
- const n = t, o = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
1330
- o.length || o.push("default"), o.forEach((i) => {
1331
- n[i] || (n[i] = {});
1416
+ function wo(e) {
1417
+ if (!e || !("modules" in e) || !Array.isArray(e.modules)) return;
1418
+ const t = e.modules.map((r) => r.moduleName).filter(Boolean);
1419
+ return t.length ? t.join(",") : void 0;
1420
+ }
1421
+ function $o(e, t, r) {
1422
+ const o = t, n = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
1423
+ n.length || n.push("default"), n.forEach((i) => {
1424
+ o[i] || (o[i] = {});
1332
1425
  });
1333
1426
  const s = {
1334
1427
  version: e.version || "",
1335
- shareScopeKeys: Array.isArray(e.shareScope) ? o : e.shareScope || "default"
1428
+ shareScopeKeys: Array.isArray(e.shareScope) ? n : e.shareScope || "default"
1336
1429
  };
1337
1430
  return Object.defineProperty(s, "shareScopeMap", {
1338
- value: n,
1431
+ value: o,
1339
1432
  enumerable: !1
1340
1433
  }), {
1341
1434
  remoteEntryInitOptions: s,
1342
- shareScope: n[o[0]],
1435
+ shareScope: o[n[0]],
1343
1436
  initScope: r ?? []
1344
1437
  };
1345
1438
  }
1346
- var Pt = class {
1439
+ var Dt = class {
1347
1440
  constructor({ remoteInfo: e, host: t }) {
1348
1441
  this.inited = !1, this.initing = !1, this.lib = void 0, this.remoteInfo = e, this.host = t;
1349
1442
  }
1350
- async getEntry() {
1443
+ async getEntry(e) {
1351
1444
  if (this.remoteEntryExports) return this.remoteEntryExports;
1352
- const e = await me({
1445
+ const t = await Ue({
1353
1446
  origin: this.host,
1354
1447
  remoteInfo: this.remoteInfo,
1355
- remoteEntryExports: this.remoteEntryExports
1448
+ remoteEntryExports: this.remoteEntryExports,
1449
+ resourceContext: {
1450
+ initiator: "loadRemote",
1451
+ id: xe(this.remoteInfo.name, e),
1452
+ resourceType: "remoteEntry"
1453
+ }
1356
1454
  });
1357
- return P(e, `remoteEntryExports is undefined
1358
- ${Ze(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
1359
- }
1360
- async init(e, t, r) {
1361
- const n = await this.getEntry();
1362
- if (this.inited) return n;
1363
- if (this.initPromise)
1364
- return await this.initPromise, n;
1455
+ return O(t, `remoteEntryExports is undefined
1456
+ ${ot(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports;
1457
+ }
1458
+ async init(e, t, r, o) {
1459
+ const n = await this.getEntry(o);
1460
+ if (this.inited)
1461
+ return await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1462
+ id: e,
1463
+ remoteInfo: this.remoteInfo,
1464
+ remoteSnapshot: t,
1465
+ remoteEntryExports: n,
1466
+ cached: !0,
1467
+ origin: this.host
1468
+ }), n;
1469
+ if (this.initPromise) {
1470
+ try {
1471
+ await this.initPromise, await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1472
+ id: e,
1473
+ remoteInfo: this.remoteInfo,
1474
+ remoteSnapshot: t,
1475
+ remoteEntryExports: n,
1476
+ cached: !0,
1477
+ origin: this.host
1478
+ });
1479
+ } catch (s) {
1480
+ throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1481
+ id: e,
1482
+ remoteInfo: this.remoteInfo,
1483
+ remoteSnapshot: t,
1484
+ remoteEntryExports: n,
1485
+ error: s,
1486
+ cached: !0,
1487
+ origin: this.host
1488
+ }), s;
1489
+ }
1490
+ return n;
1491
+ }
1365
1492
  this.initing = !0, this.initPromise = (async () => {
1366
- const { remoteEntryInitOptions: o, shareScope: s, initScope: i } = dn(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1367
- shareScope: s,
1368
- remoteEntryInitOptions: o,
1369
- initScope: i,
1493
+ await this.host.loaderHook.lifecycle.beforeInitRemote.emit({
1494
+ id: e,
1495
+ remoteInfo: this.remoteInfo,
1496
+ remoteSnapshot: t,
1497
+ origin: this.host
1498
+ });
1499
+ const { remoteEntryInitOptions: s, shareScope: i, initScope: c } = $o(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1500
+ shareScope: i,
1501
+ remoteEntryInitOptions: s,
1502
+ initScope: c,
1370
1503
  remoteInfo: this.remoteInfo,
1371
1504
  origin: this.host
1372
1505
  });
1373
- typeof (n == null ? void 0 : n.init) > "u" && $(_t, O, {
1506
+ typeof (n == null ? void 0 : n.init) > "u" && b($t, k, {
1374
1507
  hostName: this.host.name,
1375
1508
  remoteName: this.remoteInfo.name,
1376
1509
  remoteEntryUrl: this.remoteInfo.entry,
1377
1510
  remoteEntryKey: this.remoteInfo.entryGlobalName
1378
- }, void 0, z(this.host.options)), await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
1511
+ }, void 0, F(this.host.options));
1512
+ try {
1513
+ await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions);
1514
+ } catch (l) {
1515
+ b(Mt, k, {
1516
+ hostName: this.host.name,
1517
+ remoteName: this.remoteInfo.name,
1518
+ remoteEntryUrl: this.remoteInfo.entry,
1519
+ remoteEntryKey: this.remoteInfo.entryGlobalName,
1520
+ shareScope: this.remoteInfo.shareScope
1521
+ }, `${l}`, F(this.host.options));
1522
+ }
1523
+ await this.host.hooks.lifecycle.initContainer.emit({
1379
1524
  ...a,
1380
1525
  id: e,
1381
1526
  remoteSnapshot: t,
@@ -1383,40 +1528,111 @@ var Pt = class {
1383
1528
  }), this.inited = !0;
1384
1529
  })();
1385
1530
  try {
1386
- await this.initPromise;
1531
+ await this.initPromise, await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1532
+ id: e,
1533
+ remoteInfo: this.remoteInfo,
1534
+ remoteSnapshot: t,
1535
+ remoteEntryExports: n,
1536
+ origin: this.host
1537
+ });
1538
+ } catch (s) {
1539
+ throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({
1540
+ id: e,
1541
+ remoteInfo: this.remoteInfo,
1542
+ remoteSnapshot: t,
1543
+ remoteEntryExports: n,
1544
+ error: s,
1545
+ origin: this.host
1546
+ }), s;
1387
1547
  } finally {
1388
1548
  this.initing = !1, this.initPromise = void 0;
1389
1549
  }
1390
1550
  return n;
1391
1551
  }
1392
- async get(e, t, r, n) {
1393
- const { loadFactory: o = !0 } = r || { loadFactory: !0 }, s = await this.init(e, n);
1394
- this.lib = s;
1395
- let i;
1396
- i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1552
+ async get(e, t, r, o) {
1553
+ const { loadFactory: n = !0 } = r || { loadFactory: !0 }, s = await this.init(e, o, void 0, t);
1554
+ this.lib = s, await this.host.loaderHook.lifecycle.beforeGetExpose.emit({
1555
+ id: e,
1556
+ expose: t,
1557
+ moduleInfo: this.remoteInfo,
1397
1558
  remoteEntryExports: s,
1559
+ origin: this.host
1560
+ });
1561
+ let i;
1562
+ try {
1563
+ const l = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
1564
+ remoteEntryExports: s,
1565
+ expose: t,
1566
+ moduleInfo: this.remoteInfo
1567
+ });
1568
+ i = typeof l == "function" ? l : void 0, i || (i = await s.get(t)), i || b(Lt, k, {
1569
+ hostName: this.host.name,
1570
+ remoteName: this.remoteInfo.name,
1571
+ remoteEntryUrl: this.remoteInfo.entry,
1572
+ expose: t,
1573
+ requestId: e,
1574
+ availableExposes: wo(o)
1575
+ }, void 0, F(this.host.options)), await this.host.loaderHook.lifecycle.afterGetExpose.emit({
1576
+ id: e,
1577
+ expose: t,
1578
+ moduleInfo: this.remoteInfo,
1579
+ remoteEntryExports: s,
1580
+ moduleFactory: i,
1581
+ origin: this.host
1582
+ });
1583
+ } catch (l) {
1584
+ throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({
1585
+ id: e,
1586
+ expose: t,
1587
+ moduleInfo: this.remoteInfo,
1588
+ remoteEntryExports: s,
1589
+ error: l,
1590
+ origin: this.host
1591
+ }), l;
1592
+ }
1593
+ const c = Sr(this.remoteInfo.name, t), a = this.wraperFactory(i, c);
1594
+ if (!n) return a;
1595
+ await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({
1596
+ id: e,
1398
1597
  expose: t,
1399
- moduleInfo: this.remoteInfo
1400
- }), i || (i = await s.get(t)), P(i, `${Z(this.remoteInfo)} remote don't export ${t}.`);
1401
- const a = dr(this.remoteInfo.name, t), l = this.wraperFactory(i, a);
1402
- return o ? await l() : l;
1598
+ moduleInfo: this.remoteInfo,
1599
+ loadFactory: n,
1600
+ origin: this.host
1601
+ });
1602
+ try {
1603
+ const l = await a();
1604
+ return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
1605
+ id: e,
1606
+ expose: t,
1607
+ moduleInfo: this.remoteInfo,
1608
+ loadFactory: n,
1609
+ exposeModule: l,
1610
+ origin: this.host
1611
+ }), l;
1612
+ } catch (l) {
1613
+ throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
1614
+ id: e,
1615
+ expose: t,
1616
+ moduleInfo: this.remoteInfo,
1617
+ loadFactory: n,
1618
+ error: l,
1619
+ origin: this.host
1620
+ }), l;
1621
+ }
1403
1622
  }
1404
1623
  wraperFactory(e, t) {
1405
- function r(n, o) {
1406
- n && typeof n == "object" && Object.isExtensible(n) && !Object.getOwnPropertyDescriptor(n, Symbol.for("mf_module_id")) && Object.defineProperty(n, Symbol.for("mf_module_id"), {
1407
- value: o,
1624
+ function r(o, n) {
1625
+ o && typeof o == "object" && Object.isExtensible(o) && !Object.getOwnPropertyDescriptor(o, Symbol.for("mf_module_id")) && Object.defineProperty(o, Symbol.for("mf_module_id"), {
1626
+ value: n,
1408
1627
  enumerable: !1
1409
1628
  });
1410
1629
  }
1411
- return e instanceof Promise ? async () => {
1412
- const n = await e();
1413
- return r(n, t), n;
1414
- } : () => {
1415
- const n = e();
1416
- return r(n, t), n;
1630
+ return () => {
1631
+ const o = e();
1632
+ return o instanceof Promise ? o.then((n) => (r(n, t), n)) : (r(o, t), o);
1417
1633
  };
1418
1634
  }
1419
- }, v = class {
1635
+ }, A = class {
1420
1636
  constructor(e) {
1421
1637
  this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
1422
1638
  }
@@ -1425,14 +1641,15 @@ var Pt = class {
1425
1641
  }
1426
1642
  once(e) {
1427
1643
  const t = this;
1428
- this.on(function r(...n) {
1429
- return t.remove(r), e.apply(null, n);
1644
+ this.on(function r(...o) {
1645
+ return t.remove(r), e.apply(null, o);
1430
1646
  });
1431
1647
  }
1432
1648
  emit(...e) {
1433
1649
  let t;
1434
1650
  return this.listeners.size > 0 && this.listeners.forEach((r) => {
1435
- t = r(...e);
1651
+ const o = r(...e);
1652
+ o !== void 0 && (t = o);
1436
1653
  }), t;
1437
1654
  }
1438
1655
  remove(e) {
@@ -1441,131 +1658,137 @@ var Pt = class {
1441
1658
  removeAll() {
1442
1659
  this.listeners.clear();
1443
1660
  }
1444
- }, A = class extends v {
1661
+ }, I = class extends A {
1445
1662
  emit(...e) {
1446
1663
  let t;
1447
1664
  const r = Array.from(this.listeners);
1448
1665
  if (r.length > 0) {
1449
- let n = 0;
1450
- const o = (s) => s === !1 ? !1 : n < r.length ? Promise.resolve(r[n++].apply(null, e)).then(o) : s;
1451
- t = o();
1666
+ let o = 0;
1667
+ const n = (s) => s === !1 ? !1 : o < r.length ? Promise.resolve(r[o++].apply(null, e)).then((i) => i === void 0 || e.length === 1 && i === e[0] ? n(s) : n(i)) : s;
1668
+ t = n();
1452
1669
  }
1453
1670
  return Promise.resolve(t);
1454
1671
  }
1455
1672
  };
1456
- function kt(e, t) {
1457
- if (!Me(t)) return !1;
1673
+ function xt(e, t) {
1674
+ if (!Ce(t)) return !1;
1458
1675
  if (e !== t) {
1459
1676
  for (const r in e) if (!(r in t)) return !1;
1460
1677
  }
1461
1678
  return !0;
1462
1679
  }
1463
- var W = class extends v {
1680
+ var K = class extends A {
1464
1681
  constructor(e) {
1465
- super(), this.onerror = $, this.type = e;
1682
+ super(), this.onerror = b, this.type = e;
1466
1683
  }
1467
1684
  emit(e) {
1468
- Me(e) || $(`The data for the "${this.type}" hook should be an object.`);
1685
+ Ce(e) || b(`The data for the "${this.type}" hook should be an object.`);
1469
1686
  for (const t of this.listeners) try {
1470
1687
  const r = t(e);
1471
- if (kt(e, r)) e = r;
1688
+ if (r === void 0) continue;
1689
+ if (xt(e, r)) e = r;
1472
1690
  else {
1473
1691
  this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
1474
1692
  break;
1475
1693
  }
1476
1694
  } catch (r) {
1477
- Oe(r), this.onerror(r);
1695
+ te(r), this.onerror(r);
1478
1696
  }
1479
1697
  return e;
1480
1698
  }
1481
- }, D = class extends v {
1699
+ }, H = class extends A {
1482
1700
  constructor(e) {
1483
- super(), this.onerror = $, this.type = e;
1701
+ super(), this.onerror = b, this.type = e;
1484
1702
  }
1485
1703
  emit(e) {
1486
- Me(e) || $(`The response data for the "${this.type}" hook must be an object.`);
1704
+ Ce(e) || b(`The response data for the "${this.type}" hook must be an object.`);
1487
1705
  const t = Array.from(this.listeners);
1488
1706
  if (t.length > 0) {
1489
1707
  let r = 0;
1490
- const n = (s) => (Oe(s), this.onerror(s), e), o = (s) => {
1491
- if (kt(e, s)) {
1492
- if (e = s, r < t.length) try {
1493
- return Promise.resolve(t[r++](e)).then(o, n);
1494
- } catch (i) {
1495
- return n(i);
1496
- }
1497
- } else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
1708
+ const o = (s) => (te(s), this.onerror(s), e), n = (s) => {
1709
+ if (s !== void 0 && xt(e, s)) e = s;
1710
+ else if (s !== void 0)
1711
+ return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`), e;
1712
+ if (r < t.length) try {
1713
+ return Promise.resolve(t[r++](e)).then(n, o);
1714
+ } catch (i) {
1715
+ return o(i);
1716
+ }
1498
1717
  return e;
1499
1718
  };
1500
- return Promise.resolve(o(e));
1719
+ return Promise.resolve(n(e));
1501
1720
  }
1502
1721
  return Promise.resolve(e);
1503
1722
  }
1504
- }, j = class {
1723
+ }, z = class {
1505
1724
  constructor(e) {
1506
1725
  this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
1507
1726
  }
1508
1727
  applyPlugin(e, t) {
1509
- var n;
1510
- P(hr(e), "Plugin configuration is invalid.");
1728
+ var o;
1729
+ O(br(e), "Plugin configuration is invalid.");
1511
1730
  const r = e.name;
1512
- P(r, "A name must be provided by the plugin."), this.registerPlugins[r] || (this.registerPlugins[r] = e, (n = e.apply) == null || n.call(e, t), Object.keys(this.lifecycle).forEach((o) => {
1513
- const s = e[o];
1514
- s && this.lifecycle[o].on(s);
1731
+ O(r, "A name must be provided by the plugin."), this.registerPlugins[r] || (this.registerPlugins[r] = e, (o = e.apply) == null || o.call(e, t), Object.keys(this.lifecycle).forEach((n) => {
1732
+ const s = e[n];
1733
+ s && this.lifecycle[n].on(s);
1515
1734
  }));
1516
1735
  }
1517
1736
  removePlugin(e) {
1518
- P(e, "A name is required.");
1737
+ O(e, "A name is required.");
1519
1738
  const t = this.registerPlugins[e];
1520
- P(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((r) => {
1739
+ O(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((r) => {
1521
1740
  r !== "name" && this.lifecycle[r].remove(t[r]);
1522
1741
  });
1523
1742
  }
1524
1743
  };
1525
- function Ot(e, t) {
1526
- const r = ct(t);
1527
- r.url || $(Nt, O, { remoteName: e.name });
1528
- let n = Ie(t, r.url);
1529
- !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;
1744
+ function Gt(e, t) {
1745
+ const r = dt(t);
1746
+ r.url || b(kt, k, { remoteName: e.name });
1747
+ let o = ve(t, r.url);
1748
+ !D && !o.startsWith("http") && (o = `https:${o}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = o, e.version = t.version, e.buildVersion = t.buildVersion;
1530
1749
  }
1531
- function pn() {
1750
+ function Io() {
1532
1751
  return {
1533
1752
  name: "snapshot-plugin",
1534
1753
  async afterResolve(e) {
1535
- const { remote: t, pkgNameOrAlias: r, expose: n, origin: o, remoteInfo: s, id: i } = e;
1536
- if (!Le(t) || !it(t)) {
1537
- const { remoteSnapshot: a, globalSnapshot: l } = await o.snapshotHandler.loadRemoteSnapshotInfo({
1754
+ const { remote: t, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: s, id: i } = e;
1755
+ if (!Oe(t) || !ft(t)) {
1756
+ const { remoteSnapshot: c, globalSnapshot: a } = await n.snapshotHandler.loadRemoteSnapshotInfo({
1538
1757
  moduleInfo: t,
1539
- id: i
1758
+ id: xe(t.name, o)
1540
1759
  });
1541
- Ot(s, a);
1542
- const c = {
1760
+ Gt(s, c);
1761
+ const l = {
1543
1762
  remote: t,
1544
1763
  preloadConfig: {
1545
1764
  nameOrAlias: r,
1546
- exposes: [n],
1765
+ exposes: [o],
1547
1766
  resourceCategory: "sync",
1548
1767
  share: !1,
1549
1768
  depsRemote: !1
1550
1769
  }
1551
- }, u = await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1552
- origin: o,
1553
- preloadOptions: c,
1770
+ }, u = await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
1771
+ origin: n,
1772
+ preloadOptions: l,
1554
1773
  remoteInfo: s,
1555
1774
  remote: t,
1556
- remoteSnapshot: a,
1557
- globalSnapshot: l
1775
+ remoteSnapshot: c,
1776
+ globalSnapshot: a
1558
1777
  });
1559
- return u && At(s, o, u, !1), {
1778
+ return u && Ht(s, n, u, !1, {
1779
+ initiator: "loadRemote",
1780
+ id: i
1781
+ }).catch(() => {
1782
+ }), {
1560
1783
  ...e,
1561
- remoteSnapshot: a
1784
+ remoteSnapshot: c
1562
1785
  };
1563
1786
  }
1564
1787
  return e;
1565
1788
  }
1566
1789
  };
1567
1790
  }
1568
- function mn(e) {
1791
+ function No(e) {
1569
1792
  const t = e.split(":");
1570
1793
  return t.length === 1 ? {
1571
1794
  name: t[0],
@@ -1578,114 +1801,114 @@ function mn(e) {
1578
1801
  version: t[2]
1579
1802
  };
1580
1803
  }
1581
- function Lt(e, t, r, n, o = {}, s) {
1582
- const { value: i } = q(e, Z(t)), a = s || i;
1583
- if (a && !Qe(a) && (r(a, t, n), a.remotesInfo)) {
1584
- const l = Object.keys(a.remotesInfo);
1585
- for (const c of l) {
1586
- if (o[c]) continue;
1587
- o[c] = !0;
1588
- const u = mn(c), d = a.remotesInfo[c];
1589
- Lt(e, {
1804
+ function Ut(e, t, r, o, n = {}, s) {
1805
+ const { value: i } = J(e, ye(t)), c = s || i;
1806
+ if (c && !nt(c) && (r(c, t, o), c.remotesInfo)) {
1807
+ const a = Object.keys(c.remotesInfo);
1808
+ for (const l of a) {
1809
+ if (n[l]) continue;
1810
+ n[l] = !0;
1811
+ const u = No(l), f = c.remotesInfo[l];
1812
+ Ut(e, {
1590
1813
  name: u.name,
1591
- version: d.matchedVersion
1592
- }, r, !1, o, void 0);
1814
+ version: f.matchedVersion
1815
+ }, r, !1, n, void 0);
1593
1816
  }
1594
1817
  }
1595
1818
  }
1596
- const $e = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
1597
- function yn(e, t, r, n, o) {
1598
- const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: d } = t, { depsRemote: h } = d;
1599
- if (Lt(n, r, (p, m, g) => {
1600
- var w;
1601
- let y;
1602
- if (g) y = d;
1603
- else if (Array.isArray(h)) {
1604
- const S = h.find((N) => N.nameOrAlias === m.name || N.nameOrAlias === m.alias);
1819
+ const Ie = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
1820
+ function To(e, t, r, o, n) {
1821
+ const s = [], i = [], c = [], a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote: d } = f;
1822
+ if (Ut(o, r, (m, p, y) => {
1823
+ var $;
1824
+ let E;
1825
+ if (y) E = f;
1826
+ else if (Array.isArray(d)) {
1827
+ const S = d.find((v) => v.nameOrAlias === p.name || v.nameOrAlias === p.alias);
1605
1828
  if (!S) return;
1606
- y = vt(S);
1607
- } else if (h === !0) y = d;
1829
+ E = Ft(S);
1830
+ } else if (d === !0) E = f;
1608
1831
  else return;
1609
- const _ = Ie(p, ct(p).url);
1610
- _ && a.push({
1611
- name: m.name,
1832
+ const _ = ve(m, dt(m).url);
1833
+ _ && c.push({
1834
+ name: p.name,
1612
1835
  moduleInfo: {
1613
- name: m.name,
1836
+ name: p.name,
1614
1837
  entry: _,
1615
- type: "remoteEntryType" in p ? p.remoteEntryType : "global",
1616
- entryGlobalName: "globalName" in p ? p.globalName : m.name,
1838
+ type: "remoteEntryType" in m ? m.remoteEntryType : "global",
1839
+ entryGlobalName: "globalName" in m ? m.globalName : p.name,
1617
1840
  shareScope: "",
1618
- version: "version" in p ? p.version : void 0
1841
+ version: "version" in m ? m.version : void 0
1619
1842
  },
1620
1843
  url: _
1621
1844
  });
1622
- let b = "modules" in p ? p.modules : [];
1623
- const R = hn(y.exposes);
1624
- R.length && "modules" in p && (b = (w = p == null ? void 0 : p.modules) == null ? void 0 : w.reduce((S, N) => ((R == null ? void 0 : R.indexOf(N.moduleName)) !== -1 && S.push(N), S), []));
1625
- function E(S) {
1626
- const N = S.map((L) => Ie(p, L));
1627
- return y.filter ? N.filter(y.filter) : N;
1845
+ let g = "modules" in m ? m.modules : [];
1846
+ const R = Ro(E.exposes);
1847
+ R.length && "modules" in m && (g = ($ = m == null ? void 0 : m.modules) == null ? void 0 : $.reduce((S, v) => ((R == null ? void 0 : R.indexOf(v.moduleName)) !== -1 && S.push(v), S), []));
1848
+ function w(S) {
1849
+ const v = S.map((L) => ve(m, L));
1850
+ return E.filter ? v.filter(E.filter) : v;
1628
1851
  }
1629
- if (b) {
1630
- const S = b.length;
1631
- for (let N = 0; N < S; N++) {
1632
- const L = b[N], ge = `${m.name}/${L.moduleName}`;
1852
+ if (g) {
1853
+ const S = g.length;
1854
+ for (let v = 0; v < S; v++) {
1855
+ const L = g[v], ge = `${p.name}/${L.moduleName}`;
1633
1856
  e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1634
- id: L.moduleName === "." ? m.name : ge,
1635
- name: m.name,
1636
- remoteSnapshot: p,
1637
- preloadConfig: y,
1638
- remote: m,
1857
+ id: L.moduleName === "." ? p.name : ge,
1858
+ name: p.name,
1859
+ remoteSnapshot: m,
1860
+ preloadConfig: E,
1861
+ remote: p,
1639
1862
  origin: e
1640
- }), !Er(ge) && (y.resourceCategory === "all" ? (s.push(...E(L.assets.css.async)), s.push(...E(L.assets.css.sync)), i.push(...E(L.assets.js.async)), i.push(...E(L.assets.js.sync))) : y.resourceCategory === "sync" && (s.push(...E(L.assets.css.sync)), i.push(...E(L.assets.js.sync))), _r(ge));
1863
+ }), !Tr(ge) && (E.resourceCategory === "all" ? (s.push(...w(L.assets.css.async)), s.push(...w(L.assets.css.sync)), i.push(...w(L.assets.js.async)), i.push(...w(L.assets.js.sync))) : E.resourceCategory === "sync" && (s.push(...w(L.assets.css.sync)), i.push(...w(L.assets.js.sync))), vr(ge));
1641
1864
  }
1642
1865
  }
1643
- }, !0, {}, o), o.shared && o.shared.length > 0) {
1644
- const p = (m, g) => {
1645
- const { shared: y } = de(e.shareScopeMap, g.sharedName, m, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1646
- y && typeof y.lib == "function" && (g.assets.js.sync.forEach((_) => {
1866
+ }, !0, {}, n), n.shared && n.shared.length > 0) {
1867
+ const m = (p, y) => {
1868
+ const { shared: E } = pe(e.shareScopeMap, y.sharedName, p, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
1869
+ E && typeof E.lib == "function" && (y.assets.js.sync.forEach((_) => {
1870
+ a.add(_);
1871
+ }), y.assets.css.sync.forEach((_) => {
1647
1872
  l.add(_);
1648
- }), g.assets.css.sync.forEach((_) => {
1649
- c.add(_);
1650
1873
  }));
1651
1874
  };
1652
- o.shared.forEach((m) => {
1875
+ n.shared.forEach((p) => {
1653
1876
  var _;
1654
- const g = (_ = u.shared) == null ? void 0 : _[m.sharedName];
1655
- if (!g) return;
1656
- const y = m.version ? g.find((b) => b.version === m.version) : g;
1657
- y && at(y).forEach((b) => {
1658
- p(b, m);
1877
+ const y = (_ = u.shared) == null ? void 0 : _[p.sharedName];
1878
+ if (!y) return;
1879
+ const E = p.version ? y.find((g) => g.version === p.version) : y;
1880
+ E && ht(E).forEach((g) => {
1881
+ m(g, p);
1659
1882
  });
1660
1883
  });
1661
1884
  }
1662
- const f = i.filter((p) => !l.has(p) && !$e("script", p));
1885
+ const h = i.filter((m) => !a.has(m) && !Ie("script", m));
1663
1886
  return {
1664
- cssAssets: s.filter((p) => !c.has(p) && !$e("link", p)),
1665
- jsAssetsWithoutEntry: f,
1666
- entryAssets: a.filter((p) => !$e("script", p.url))
1887
+ cssAssets: s.filter((m) => !l.has(m) && !Ie("link", m)),
1888
+ jsAssetsWithoutEntry: h,
1889
+ entryAssets: c.filter((m) => !Ie("script", m.url))
1667
1890
  };
1668
1891
  }
1669
- const gn = function() {
1892
+ const vo = function() {
1670
1893
  return {
1671
1894
  name: "generate-preload-assets-plugin",
1672
1895
  async generatePreloadAssets(e) {
1673
- const { origin: t, preloadOptions: r, remoteInfo: n, remote: o, globalSnapshot: s, remoteSnapshot: i } = e;
1674
- return F ? Le(o) && it(o) ? {
1896
+ const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot: i } = e;
1897
+ return D ? Oe(n) && ft(n) ? {
1675
1898
  cssAssets: [],
1676
1899
  jsAssetsWithoutEntry: [],
1677
1900
  entryAssets: [{
1678
- name: o.name,
1679
- url: o.entry,
1901
+ name: n.name,
1902
+ url: n.entry,
1680
1903
  moduleInfo: {
1681
- name: n.name,
1682
- entry: o.entry,
1683
- type: n.type || "global",
1904
+ name: o.name,
1905
+ entry: n.entry,
1906
+ type: o.type || "global",
1684
1907
  entryGlobalName: "",
1685
1908
  shareScope: ""
1686
1909
  }
1687
1910
  }]
1688
- } : (Ot(n, i), yn(t, r, n, s, i)) : {
1911
+ } : (Gt(o, i), To(t, r, o, s, i)) : {
1689
1912
  cssAssets: [],
1690
1913
  jsAssetsWithoutEntry: [],
1691
1914
  entryAssets: []
@@ -1693,132 +1916,156 @@ const gn = function() {
1693
1916
  }
1694
1917
  };
1695
1918
  };
1696
- function Mt(e, t) {
1697
- const r = ue({
1919
+ function Bt(e, t) {
1920
+ const r = he({
1698
1921
  name: t.name,
1699
1922
  version: t.options.version
1700
- }), n = r && "remotesInfo" in r && r.remotesInfo && q(r.remotesInfo, e.name).value;
1701
- return n && n.matchedVersion ? {
1923
+ }), o = r && "remotesInfo" in r && r.remotesInfo && J(r.remotesInfo, e.name).value;
1924
+ return o && o.matchedVersion ? {
1702
1925
  hostGlobalSnapshot: r,
1703
- globalSnapshot: Ge(),
1704
- remoteSnapshot: ue({
1926
+ globalSnapshot: Ve(),
1927
+ remoteSnapshot: he({
1705
1928
  name: e.name,
1706
- version: n.matchedVersion
1929
+ version: o.matchedVersion
1707
1930
  })
1708
1931
  } : {
1709
1932
  hostGlobalSnapshot: void 0,
1710
- globalSnapshot: Ge(),
1711
- remoteSnapshot: ue({
1933
+ globalSnapshot: Ve(),
1934
+ remoteSnapshot: he({
1712
1935
  name: e.name,
1713
1936
  version: "version" in e ? e.version : void 0
1714
1937
  })
1715
1938
  };
1716
1939
  }
1717
- var En = class {
1940
+ var Ao = class {
1718
1941
  constructor(e) {
1719
- this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new j({
1720
- beforeLoadRemoteSnapshot: new A("beforeLoadRemoteSnapshot"),
1721
- loadSnapshot: new D("loadGlobalSnapshot"),
1722
- loadRemoteSnapshot: new D("loadRemoteSnapshot"),
1723
- afterLoadSnapshot: new D("afterLoadSnapshot")
1724
- }), this.manifestLoading = Q.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
1725
- }
1726
- async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, expose: r }) {
1727
- const { options: n } = this.HostInstance;
1942
+ this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new z({
1943
+ beforeLoadRemoteSnapshot: new I("beforeLoadRemoteSnapshot"),
1944
+ loadSnapshot: new H("loadGlobalSnapshot"),
1945
+ loadRemoteSnapshot: new H("loadRemoteSnapshot"),
1946
+ afterLoadSnapshot: new H("afterLoadSnapshot")
1947
+ }), this.manifestLoading = re.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
1948
+ }
1949
+ async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, initiator: r = "loadRemote" }) {
1950
+ const { options: o } = this.HostInstance;
1728
1951
  await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
1729
- options: n,
1730
- moduleInfo: e
1952
+ options: o,
1953
+ moduleInfo: e,
1954
+ origin: this.HostInstance
1731
1955
  });
1732
- let o = ue({
1956
+ let n = he({
1733
1957
  name: this.HostInstance.options.name,
1734
1958
  version: this.HostInstance.options.version
1735
1959
  });
1736
- o || (o = {
1960
+ n || (n = {
1737
1961
  version: this.HostInstance.options.version || "",
1738
1962
  remoteEntry: "",
1739
1963
  remotesInfo: {}
1740
- }, yr({ [this.HostInstance.options.name]: o })), o && "remotesInfo" in o && !q(o.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (o.remotesInfo = {
1741
- ...o == null ? void 0 : o.remotesInfo,
1964
+ }, Ir({ [this.HostInstance.options.name]: n })), n && "remotesInfo" in n && !J(n.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (n.remotesInfo = {
1965
+ ...n == null ? void 0 : n.remotesInfo,
1742
1966
  [e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
1743
1967
  });
1744
- const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: a } = this.getGlobalRemoteInfo(e), { remoteSnapshot: l, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
1745
- options: n,
1968
+ const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: c } = this.getGlobalRemoteInfo(e), { remoteSnapshot: a, globalSnapshot: l } = await this.hooks.lifecycle.loadSnapshot.emit({
1969
+ options: o,
1746
1970
  moduleInfo: e,
1747
1971
  hostGlobalSnapshot: s,
1748
1972
  remoteSnapshot: i,
1749
- globalSnapshot: a
1973
+ globalSnapshot: c
1750
1974
  });
1751
- let u, d;
1752
- if (l) if (Qe(l)) {
1753
- const h = F ? l.remoteEntry : l.ssrRemoteEntry || l.remoteEntry || "", f = await this.getManifestJson(h, e, {}), p = xe({
1975
+ let u, f;
1976
+ if (a) if (nt(a)) {
1977
+ const d = D ? a.remoteEntry : a.ssrRemoteEntry || a.remoteEntry || "", h = await this.loadManifestSnapshot(d, e, {}, {
1978
+ initiator: r,
1979
+ id: t || e.name
1980
+ }), m = We({
1754
1981
  ...e,
1755
- entry: h
1756
- }, f);
1757
- u = f, d = p;
1982
+ entry: d
1983
+ }, h);
1984
+ u = h, f = m;
1758
1985
  } else {
1759
- const { remoteSnapshot: h } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1986
+ const { remoteSnapshot: d } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1760
1987
  options: this.HostInstance.options,
1761
1988
  moduleInfo: e,
1762
- remoteSnapshot: l,
1989
+ remoteSnapshot: a,
1763
1990
  from: "global"
1764
1991
  });
1765
- u = h, d = c;
1992
+ u = d, f = l;
1766
1993
  }
1767
- else if (Le(e)) {
1768
- const h = await this.getManifestJson(e.entry, e, {}), f = xe(e, h), { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1769
- options: this.HostInstance.options,
1770
- moduleInfo: e,
1771
- remoteSnapshot: h,
1772
- from: "global"
1773
- });
1774
- u = p, d = f;
1775
- } else $($t, O, {
1994
+ else if (Oe(e)) {
1995
+ const d = await this.loadManifestSnapshot(e.entry, e, {}, {
1996
+ initiator: r,
1997
+ id: t || e.name
1998
+ }), h = We(e, d);
1999
+ u = d, f = h;
2000
+ } else b(vt, k, {
1776
2001
  remoteName: e.name,
1777
2002
  remoteVersion: e.version,
1778
2003
  hostName: this.HostInstance.options.name,
1779
- globalSnapshot: JSON.stringify(c)
1780
- }, void 0, z(this.HostInstance.options));
2004
+ globalSnapshot: JSON.stringify(l)
2005
+ }, void 0, F(this.HostInstance.options));
1781
2006
  return await this.hooks.lifecycle.afterLoadSnapshot.emit({
1782
2007
  id: t,
1783
2008
  host: this.HostInstance,
1784
- options: n,
2009
+ options: o,
1785
2010
  moduleInfo: e,
1786
2011
  remoteSnapshot: u
1787
2012
  }), {
1788
2013
  remoteSnapshot: u,
1789
- globalSnapshot: d
2014
+ globalSnapshot: f
1790
2015
  };
1791
2016
  }
1792
2017
  getGlobalRemoteInfo(e) {
1793
- return Mt(e, this.HostInstance);
2018
+ return Bt(e, this.HostInstance);
1794
2019
  }
1795
- async getManifestJson(e, t, r) {
1796
- const n = async () => {
1797
- let s = this.manifestCache.get(e);
1798
- if (s) return s;
2020
+ async getManifestJson(e, t, r, o) {
2021
+ return (async () => {
2022
+ const s = q(t);
2023
+ let i = this.manifestCache.get(e);
2024
+ if (i) return i;
1799
2025
  try {
1800
- let i = await this.loaderHook.lifecycle.fetch.emit(e, {}, ye(t));
1801
- (!i || !(i instanceof Response)) && (i = await fetch(e, {})), s = await i.json();
1802
- } catch (i) {
1803
- s = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2026
+ let a = await this.loaderHook.lifecycle.fetch.emit(e, {}, s, o ? {
2027
+ ...o,
2028
+ url: e,
2029
+ resourceType: "manifest"
2030
+ } : void 0);
2031
+ (!a || !(a instanceof Response)) && (a = await fetch(e, {})), i = await a.json();
2032
+ } catch (a) {
2033
+ i = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1804
2034
  id: e,
1805
- error: i,
2035
+ error: a,
1806
2036
  from: "runtime",
1807
2037
  lifecycle: "afterResolve",
2038
+ remote: s,
1808
2039
  origin: this.HostInstance
1809
- }), s || (delete this.manifestLoading[e], $(bt, O, {
2040
+ }), i || (delete this.manifestLoading[e], b(It, k, {
1810
2041
  manifestUrl: e,
1811
2042
  moduleName: t.name,
1812
2043
  hostName: this.HostInstance.options.name
1813
- }, `${i}`, z(this.HostInstance.options)));
2044
+ }, `${a}`, F(this.HostInstance.options)));
1814
2045
  }
1815
- return P(s.metaData && s.exposes && s.shared, `"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[
1816
- !s.metaData && "metaData",
1817
- !s.exposes && "exposes",
1818
- !s.shared && "shared"
1819
- ].filter(Boolean).join(", ")}.`), this.manifestCache.set(e, s), s;
1820
- }, o = async () => {
1821
- const s = await n(), i = Qt(s, { version: e }), { remoteSnapshot: a } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
2046
+ const c = [
2047
+ !i.metaData && "metaData",
2048
+ !i.exposes && "exposes",
2049
+ !i.shared && "shared"
2050
+ ].filter(Boolean);
2051
+ return c.length > 0 && await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2052
+ id: e,
2053
+ error: /* @__PURE__ */ new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${c.join(", ")}.`),
2054
+ from: "runtime",
2055
+ lifecycle: "afterResolve",
2056
+ remote: s,
2057
+ origin: this.HostInstance
2058
+ }), c.length > 0 && b(Pt, k, {
2059
+ manifestUrl: e,
2060
+ moduleName: t.name,
2061
+ hostName: this.HostInstance.options.name,
2062
+ missingFields: c.join(",")
2063
+ }, void 0, F(this.HostInstance.options)), this.manifestCache.set(e, i), i;
2064
+ })();
2065
+ }
2066
+ async loadManifestSnapshot(e, t, r, o) {
2067
+ const n = async () => {
2068
+ const s = await this.getManifestJson(e, t, r, o), i = ar(s, { version: e }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1822
2069
  options: this.HostInstance.options,
1823
2070
  moduleInfo: t,
1824
2071
  manifestJson: s,
@@ -1826,33 +2073,66 @@ var En = class {
1826
2073
  manifestUrl: e,
1827
2074
  from: "manifest"
1828
2075
  });
1829
- return a;
2076
+ return c;
1830
2077
  };
1831
- return this.manifestLoading[e] || (this.manifestLoading[e] = o().then((s) => s)), this.manifestLoading[e];
2078
+ return this.manifestLoading[e] || (this.manifestLoading[e] = n().then((s) => s)), this.manifestLoading[e];
1832
2079
  }
1833
- }, _n = class {
2080
+ }, ko = class {
1834
2081
  constructor(e) {
1835
- this.hooks = new j({
1836
- beforeRegisterShare: new W("beforeRegisterShare"),
1837
- afterResolve: new D("afterResolve"),
1838
- beforeLoadShare: new D("beforeLoadShare"),
1839
- loadShare: new A(),
1840
- resolveShare: new W("resolveShare"),
1841
- initContainerShareScopeMap: new W("initContainerShareScopeMap")
2082
+ this.hooks = new z({
2083
+ beforeRegisterShare: new K("beforeRegisterShare"),
2084
+ afterResolve: new H("afterResolve"),
2085
+ beforeLoadShare: new H("beforeLoadShare"),
2086
+ loadShare: new I(),
2087
+ afterLoadShare: new A("afterLoadShare"),
2088
+ errorLoadShare: new A("errorLoadShare"),
2089
+ resolveShare: new K("resolveShare"),
2090
+ initContainerShareScopeMap: new K("initContainerShareScopeMap")
1842
2091
  }), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
1843
2092
  }
2093
+ emitAfterLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, selectedShared: o }) {
2094
+ try {
2095
+ this.hooks.lifecycle.afterLoadShare.emit({
2096
+ pkgName: t,
2097
+ shareInfo: r,
2098
+ selectedShared: o,
2099
+ shared: this.host.options.shared,
2100
+ shareScopeMap: this.shareScopeMap,
2101
+ lifecycle: e,
2102
+ origin: this.host
2103
+ });
2104
+ } catch (n) {
2105
+ te(n);
2106
+ }
2107
+ }
2108
+ emitErrorLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, error: o, recovered: n }) {
2109
+ try {
2110
+ this.hooks.lifecycle.errorLoadShare.emit({
2111
+ pkgName: t,
2112
+ shareInfo: r,
2113
+ shared: this.host.options.shared,
2114
+ shareScopeMap: this.shareScopeMap,
2115
+ lifecycle: e,
2116
+ origin: this.host,
2117
+ error: o,
2118
+ recovered: n
2119
+ });
2120
+ } catch (s) {
2121
+ te(s);
2122
+ }
2123
+ }
1844
2124
  registerShared(e, t) {
1845
- const { newShareInfos: r, allShareInfos: n } = yt(e, t);
1846
- return Object.keys(r).forEach((o) => {
1847
- r[o].forEach((s) => {
2125
+ const { newShareInfos: r, allShareInfos: o } = bt(e, t);
2126
+ return Object.keys(r).forEach((n) => {
2127
+ r[n].forEach((s) => {
1848
2128
  s.scope.forEach((i) => {
1849
- var a;
2129
+ var c;
1850
2130
  this.hooks.lifecycle.beforeRegisterShare.emit({
1851
2131
  origin: this.host,
1852
- pkgName: o,
2132
+ pkgName: n,
1853
2133
  shared: s
1854
- }), (a = this.shareScopeMap[i]) != null && a[o] || this.setShared({
1855
- pkgName: o,
2134
+ }), (c = this.shareScopeMap[i]) != null && c[n] || this.setShared({
2135
+ pkgName: n,
1856
2136
  lib: s.lib,
1857
2137
  get: s.get,
1858
2138
  loaded: s.loaded || !!s.lib,
@@ -1863,69 +2143,107 @@ var En = class {
1863
2143
  });
1864
2144
  }), {
1865
2145
  newShareInfos: r,
1866
- allShareInfos: n
2146
+ allShareInfos: o
1867
2147
  };
1868
2148
  }
1869
2149
  async loadShare(e, t) {
1870
- const { host: r } = this, n = qe({
2150
+ const { host: r } = this, o = Xe({
1871
2151
  pkgName: e,
1872
2152
  extraOptions: t,
1873
2153
  shareInfos: r.options.shared
1874
2154
  });
1875
- n != null && n.scope && await Promise.all(n.scope.map(async (a) => {
1876
- await Promise.all(this.initializeSharing(a, { strategy: n.strategy }));
1877
- }));
1878
- const { shareInfo: o } = await this.hooks.lifecycle.beforeLoadShare.emit({
1879
- pkgName: e,
1880
- shareInfo: n,
1881
- shared: r.options.shared,
1882
- origin: r
1883
- });
1884
- P(o, `Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
1885
- const { shared: s, useTreesShaking: i } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1886
- if (s) {
1887
- const a = ie(s, i);
1888
- if (a.lib)
1889
- return U(a, r.options.name), a.lib;
1890
- if (a.loading && !a.loaded) {
1891
- const l = await a.loading;
1892
- return a.loaded = !0, a.lib || (a.lib = l), U(a, r.options.name), l;
2155
+ let n = o;
2156
+ try {
2157
+ o != null && o.scope && await Promise.all(o.scope.map(async (a) => {
2158
+ await Promise.all(this.initializeSharing(a, { strategy: o.strategy }));
2159
+ })), n = (await this.hooks.lifecycle.beforeLoadShare.emit({
2160
+ pkgName: e,
2161
+ shareInfo: o,
2162
+ shared: r.options.shared,
2163
+ origin: r
2164
+ })).shareInfo, O(n, `Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
2165
+ const s = n, { shared: i, useTreesShaking: c } = pe(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
2166
+ if (i) {
2167
+ const a = ce(i, c);
2168
+ if (a.lib)
2169
+ return V(a, r.options.name), this.emitAfterLoadShare({
2170
+ lifecycle: "loadShare",
2171
+ pkgName: e,
2172
+ shareInfo: s,
2173
+ selectedShared: i
2174
+ }), a.lib;
2175
+ if (a.loading && !a.loaded) {
2176
+ const l = await a.loading;
2177
+ return a.loaded = !0, a.lib || (a.lib = l), V(a, r.options.name), this.emitAfterLoadShare({
2178
+ lifecycle: "loadShare",
2179
+ pkgName: e,
2180
+ shareInfo: s,
2181
+ selectedShared: i
2182
+ }), l;
2183
+ } else {
2184
+ const u = (async () => {
2185
+ const d = await a.get();
2186
+ return V(a, r.options.name), a.loaded = !0, a.lib = d, d;
2187
+ })();
2188
+ this.setShared({
2189
+ pkgName: e,
2190
+ loaded: !1,
2191
+ shared: i,
2192
+ from: r.options.name,
2193
+ lib: null,
2194
+ loading: u,
2195
+ treeShaking: c ? a : void 0
2196
+ });
2197
+ const f = await u;
2198
+ return this.emitAfterLoadShare({
2199
+ lifecycle: "loadShare",
2200
+ pkgName: e,
2201
+ shareInfo: s,
2202
+ selectedShared: i
2203
+ }), f;
2204
+ }
1893
2205
  } else {
1894
- const c = (async () => {
1895
- const u = await a.get();
1896
- return U(a, r.options.name), a.loaded = !0, a.lib = u, u;
2206
+ if (t != null && t.customShareInfo)
2207
+ return this.emitErrorLoadShare({
2208
+ lifecycle: "loadShare",
2209
+ pkgName: e,
2210
+ shareInfo: s,
2211
+ recovered: !0
2212
+ }), !1;
2213
+ const a = oe(s.treeShaking), l = ce(s, a), f = (async () => {
2214
+ const h = await l.get();
2215
+ l.lib = h, l.loaded = !0, V(l, r.options.name);
2216
+ const { shared: m, useTreesShaking: p } = pe(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare) || {};
2217
+ if (m) {
2218
+ const y = ce(m, p);
2219
+ y.lib = h, y.loaded = !0, m.from = s.from;
2220
+ }
2221
+ return h;
1897
2222
  })();
1898
- return this.setShared({
2223
+ this.setShared({
1899
2224
  pkgName: e,
1900
2225
  loaded: !1,
1901
2226
  shared: s,
1902
2227
  from: r.options.name,
1903
2228
  lib: null,
1904
- loading: c,
1905
- treeShaking: i ? a : void 0
1906
- }), c;
2229
+ loading: f,
2230
+ treeShaking: a ? l : void 0
2231
+ });
2232
+ const d = await f;
2233
+ return this.emitAfterLoadShare({
2234
+ lifecycle: "loadShare",
2235
+ pkgName: e,
2236
+ shareInfo: s,
2237
+ selectedShared: s
2238
+ }), d;
1907
2239
  }
1908
- } else {
1909
- if (t != null && t.customShareInfo) return !1;
1910
- const a = ee(o.treeShaking), l = ie(o, a), u = (async () => {
1911
- const d = await l.get();
1912
- l.lib = d, l.loaded = !0, U(l, r.options.name);
1913
- const { shared: h, useTreesShaking: f } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
1914
- if (h) {
1915
- const p = ie(h, f);
1916
- p.lib = d, p.loaded = !0, h.from = o.from;
1917
- }
1918
- return d;
1919
- })();
1920
- return this.setShared({
2240
+ } catch (s) {
2241
+ throw this.emitErrorLoadShare({
2242
+ lifecycle: "loadShare",
1921
2243
  pkgName: e,
1922
- loaded: !1,
1923
- shared: o,
1924
- from: r.options.name,
1925
- lib: null,
1926
- loading: u,
1927
- treeShaking: a ? l : void 0
1928
- }), u;
2244
+ shareInfo: n,
2245
+ error: s
2246
+ }), s;
1929
2247
  }
1930
2248
  }
1931
2249
  /**
@@ -1933,382 +2251,540 @@ var En = class {
1933
2251
  * It accepts one argument, the name of the share scope.
1934
2252
  * If the share scope does not exist, it creates one.
1935
2253
  */
1936
- initializeSharing(e = re, t) {
1937
- const { host: r } = this, n = t == null ? void 0 : t.from, o = t == null ? void 0 : t.strategy;
2254
+ initializeSharing(e = se, t) {
2255
+ const { host: r } = this, o = t == null ? void 0 : t.from, n = t == null ? void 0 : t.strategy;
1938
2256
  let s = t == null ? void 0 : t.initScope;
1939
2257
  const i = [];
1940
- if (n !== "build") {
1941
- const { initTokens: h } = this;
2258
+ if (o !== "build") {
2259
+ const { initTokens: d } = this;
1942
2260
  s || (s = []);
1943
- let f = h[e];
1944
- if (f || (f = h[e] = { from: this.host.name }), s.indexOf(f) >= 0) return i;
1945
- s.push(f);
2261
+ let h = d[e];
2262
+ if (h || (h = d[e] = { from: this.host.name }), s.indexOf(h) >= 0) return i;
2263
+ s.push(h);
1946
2264
  }
1947
- const a = this.shareScopeMap, l = r.options.name;
1948
- a[e] || (a[e] = {});
1949
- const c = a[e], u = (h, f) => {
1950
- var b;
1951
- const { version: p, eager: m } = f;
1952
- c[h] = c[h] || {};
1953
- const g = c[h], y = g[p] && ie(g[p]), _ = !!(y && ("eager" in y && y.eager || "shareConfig" in y && ((b = y.shareConfig) != null && b.eager)));
1954
- (!y || y.strategy !== "loaded-first" && !y.loaded && (!m != !_ ? m : l > g[p].from)) && (g[p] = f);
1955
- }, d = async (h) => {
1956
- const { module: f } = await r.remoteHandler.getRemoteModuleAndOptions({ id: h });
1957
- let p;
2265
+ const c = this.shareScopeMap, a = r.options.name;
2266
+ c[e] || (c[e] = {});
2267
+ const l = c[e], u = (d, h) => {
2268
+ var g;
2269
+ const { version: m, eager: p } = h;
2270
+ l[d] = l[d] || {};
2271
+ const y = l[d], E = y[m] && ce(y[m]), _ = !!(E && ("eager" in E && E.eager || "shareConfig" in E && ((g = E.shareConfig) != null && g.eager)));
2272
+ (!E || E.strategy !== "loaded-first" && !E.loaded && (!p != !_ ? p : a > y[m].from)) && (y[m] = h);
2273
+ }, f = async (d) => {
2274
+ const { module: h } = await r.remoteHandler.getRemoteModuleAndOptions({ id: d });
2275
+ let m;
1958
2276
  try {
1959
- p = await f.getEntry();
1960
- } catch (m) {
1961
- if (p = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1962
- id: h,
1963
- error: m,
2277
+ m = await h.getEntry();
2278
+ } catch (p) {
2279
+ if (m = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
2280
+ id: d,
2281
+ error: p,
1964
2282
  from: "runtime",
1965
2283
  lifecycle: "beforeLoadShare",
2284
+ remote: h.remoteInfo,
1966
2285
  origin: r
1967
- }), !p) return;
2286
+ }), !m) return;
1968
2287
  } finally {
1969
- p != null && p.init && !f.initing && (f.remoteEntryExports = p, await f.init(void 0, void 0, s));
2288
+ m != null && m.init && !h.initing && (h.remoteEntryExports = m, await h.init(void 0, void 0, s));
1970
2289
  }
1971
2290
  };
1972
- return Object.keys(r.options.shared).forEach((h) => {
1973
- r.options.shared[h].forEach((f) => {
1974
- f.scope.includes(e) && u(h, f);
2291
+ return Object.keys(r.options.shared).forEach((d) => {
2292
+ r.options.shared[d].forEach((h) => {
2293
+ h.scope.includes(e) && u(d, h);
1975
2294
  });
1976
- }), (r.options.shareStrategy === "version-first" || o === "version-first") && r.options.remotes.forEach((h) => {
1977
- h.shareScope === e && i.push(d(h.name));
2295
+ }), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((d) => {
2296
+ d.shareScope === e && i.push(f(d.name));
1978
2297
  }), i;
1979
2298
  }
1980
2299
  loadShareSync(e, t) {
1981
- const { host: r } = this, n = qe({
2300
+ const { host: r } = this, o = Xe({
1982
2301
  pkgName: e,
1983
2302
  extraOptions: t,
1984
2303
  shareInfos: r.options.shared
1985
2304
  });
1986
- n != null && n.scope && n.scope.forEach((i) => {
1987
- this.initializeSharing(i, { strategy: n.strategy });
1988
- });
1989
- const { shared: o, useTreesShaking: s } = de(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
1990
- if (o) {
1991
- if (typeof o.lib == "function")
1992
- return U(o, r.options.name), o.loaded || (o.loaded = !0, o.from === r.options.name && (n.loaded = !0)), o.lib;
1993
- if (typeof o.get == "function") {
1994
- const i = o.get();
1995
- if (!(i instanceof Promise))
1996
- return U(o, r.options.name), this.setShared({
2305
+ try {
2306
+ o != null && o.scope && o.scope.forEach((s) => {
2307
+ this.initializeSharing(s, { strategy: o.strategy });
2308
+ });
2309
+ const { shared: n } = pe(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
2310
+ if (n) {
2311
+ if (typeof n.lib == "function")
2312
+ return V(n, r.options.name), n.loaded || (n.loaded = !0, n.from === r.options.name && (o.loaded = !0)), this.emitAfterLoadShare({
2313
+ lifecycle: "loadShareSync",
1997
2314
  pkgName: e,
1998
- loaded: !0,
1999
- from: r.options.name,
2000
- lib: i,
2001
- shared: o
2002
- }), i;
2315
+ shareInfo: o,
2316
+ selectedShared: n
2317
+ }), n.lib;
2318
+ if (typeof n.get == "function") {
2319
+ const s = n.get();
2320
+ if (!(s instanceof Promise))
2321
+ return V(n, r.options.name), this.setShared({
2322
+ pkgName: e,
2323
+ loaded: !0,
2324
+ from: r.options.name,
2325
+ lib: s,
2326
+ shared: n
2327
+ }), this.emitAfterLoadShare({
2328
+ lifecycle: "loadShareSync",
2329
+ pkgName: e,
2330
+ shareInfo: o,
2331
+ selectedShared: n
2332
+ }), s;
2333
+ }
2003
2334
  }
2004
- }
2005
- if (n.lib)
2006
- return n.loaded || (n.loaded = !0), n.lib;
2007
- if (n.get) {
2008
- const i = n.get();
2009
- return i instanceof Promise && $((t == null ? void 0 : t.from) === "build" ? St : Pe, O, {
2335
+ if (o.lib)
2336
+ return o.loaded || (o.loaded = !0), this.emitAfterLoadShare({
2337
+ lifecycle: "loadShareSync",
2338
+ pkgName: e,
2339
+ shareInfo: o,
2340
+ selectedShared: o
2341
+ }), o.lib;
2342
+ if (o.get) {
2343
+ const s = o.get();
2344
+ return s instanceof Promise && b((t == null ? void 0 : t.from) === "build" ? Tt : Le, k, {
2345
+ hostName: r.options.name,
2346
+ sharedPkgName: e
2347
+ }, void 0, F(r.options)), o.lib = s, this.setShared({
2348
+ pkgName: e,
2349
+ loaded: !0,
2350
+ from: r.options.name,
2351
+ lib: o.lib,
2352
+ shared: o
2353
+ }), this.emitAfterLoadShare({
2354
+ lifecycle: "loadShareSync",
2355
+ pkgName: e,
2356
+ shareInfo: o,
2357
+ selectedShared: o
2358
+ }), o.lib;
2359
+ }
2360
+ b(Le, k, {
2010
2361
  hostName: r.options.name,
2011
2362
  sharedPkgName: e
2012
- }, void 0, z(r.options)), n.lib = i, this.setShared({
2363
+ }, void 0, F(r.options));
2364
+ } catch (n) {
2365
+ throw this.emitErrorLoadShare({
2366
+ lifecycle: "loadShareSync",
2013
2367
  pkgName: e,
2014
- loaded: !0,
2015
- from: r.options.name,
2016
- lib: n.lib,
2017
- shared: n
2018
- }), n.lib;
2368
+ shareInfo: o,
2369
+ error: n
2370
+ }), n;
2019
2371
  }
2020
- $(Pe, O, {
2021
- hostName: r.options.name,
2022
- sharedPkgName: e
2023
- }, void 0, z(r.options));
2024
2372
  }
2025
2373
  initShareScopeMap(e, t, r = {}) {
2026
- const { host: n } = this;
2374
+ const { host: o } = this;
2027
2375
  this.shareScopeMap[e] = t, this.hooks.lifecycle.initContainerShareScopeMap.emit({
2028
2376
  shareScope: t,
2029
- options: n.options,
2030
- origin: n,
2377
+ options: o.options,
2378
+ origin: o,
2031
2379
  scopeName: e,
2032
2380
  hostShareScopeMap: r.hostShareScopeMap
2033
2381
  });
2034
2382
  }
2035
- setShared({ pkgName: e, shared: t, from: r, lib: n, loading: o, loaded: s, get: i, treeShaking: a }) {
2036
- const { version: l, scope: c = "default", ...u } = t, d = Array.isArray(c) ? c : [c], h = (f) => {
2037
- const p = (g, y, _) => {
2038
- _ && !g[y] && (g[y] = _);
2039
- }, m = a ? f.treeShaking : f;
2040
- p(m, "loaded", s), p(m, "loading", o), p(m, "get", i);
2383
+ setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get: i, treeShaking: c }) {
2384
+ const { version: a, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l], d = (h) => {
2385
+ const m = (y, E, _) => {
2386
+ _ && !y[E] && (y[E] = _);
2387
+ }, p = c ? h.treeShaking : h;
2388
+ m(p, "loaded", s), m(p, "loading", n), m(p, "get", i);
2041
2389
  };
2042
- d.forEach((f) => {
2043
- this.shareScopeMap[f] || (this.shareScopeMap[f] = {}), this.shareScopeMap[f][e] || (this.shareScopeMap[f][e] = {}), this.shareScopeMap[f][e][l] || (this.shareScopeMap[f][e][l] = {
2044
- version: l,
2045
- scope: [f],
2390
+ f.forEach((h) => {
2391
+ this.shareScopeMap[h] || (this.shareScopeMap[h] = {}), this.shareScopeMap[h][e] || (this.shareScopeMap[h][e] = {}), this.shareScopeMap[h][e][a] || (this.shareScopeMap[h][e][a] = {
2392
+ version: a,
2393
+ scope: [h],
2046
2394
  ...u,
2047
- lib: n
2395
+ lib: o
2048
2396
  });
2049
- const p = this.shareScopeMap[f][e][l];
2050
- h(p), r && p.from !== r && (p.from = r);
2397
+ const m = this.shareScopeMap[h][e][a];
2398
+ d(m), r && m.from !== r && (m.from = r);
2051
2399
  });
2052
2400
  }
2053
2401
  _setGlobalShareScopeMap(e) {
2054
- const t = gt(), r = e.id || e.name;
2402
+ const t = St(), r = e.id || e.name;
2055
2403
  r && !t[r] && (t[r] = this.shareScopeMap);
2056
2404
  }
2057
- }, bn = class {
2405
+ }, Po = class {
2058
2406
  constructor(e) {
2059
- this.hooks = new j({
2060
- beforeRegisterRemote: new W("beforeRegisterRemote"),
2061
- registerRemote: new W("registerRemote"),
2062
- beforeRequest: new D("beforeRequest"),
2063
- onLoad: new A("onLoad"),
2064
- handlePreloadModule: new v("handlePreloadModule"),
2065
- errorLoadRemote: new A("errorLoadRemote"),
2066
- beforePreloadRemote: new A("beforePreloadRemote"),
2067
- generatePreloadAssets: new A("generatePreloadAssets"),
2068
- afterPreloadRemote: new A(),
2069
- loadEntry: new A()
2407
+ this.hooks = new z({
2408
+ beforeRegisterRemote: new K("beforeRegisterRemote"),
2409
+ registerRemote: new K("registerRemote"),
2410
+ beforeRequest: new H("beforeRequest"),
2411
+ afterMatchRemote: new I("afterMatchRemote"),
2412
+ onLoad: new I("onLoad"),
2413
+ afterLoadRemote: new I("afterLoadRemote"),
2414
+ handlePreloadModule: new A("handlePreloadModule"),
2415
+ errorLoadRemote: new I("errorLoadRemote"),
2416
+ beforePreloadRemote: new I("beforePreloadRemote"),
2417
+ generatePreloadAssets: new I("generatePreloadAssets"),
2418
+ afterPreloadRemote: new I("afterPreloadRemote"),
2419
+ loadEntry: new I()
2070
2420
  }), this.host = e, this.idToRemoteMap = {};
2071
2421
  }
2072
2422
  formatAndRegisterRemote(e, t) {
2073
- return (t.remotes || []).reduce((r, n) => (this.registerRemote(n, r, { force: !1 }), r), e.remotes);
2423
+ return (t.remotes || []).reduce((r, o) => (this.registerRemote(o, r, { force: !1 }), r), e.remotes);
2074
2424
  }
2075
2425
  setIdToRemoteMap(e, t) {
2076
- const { remote: r, expose: n } = t, { name: o, alias: s } = r;
2426
+ const { remote: r, expose: o } = t, { name: n, alias: s } = r;
2077
2427
  if (this.idToRemoteMap[e] = {
2078
2428
  name: r.name,
2079
- expose: n
2080
- }, s && e.startsWith(o)) {
2081
- const i = e.replace(o, s);
2429
+ expose: o
2430
+ }, s && e.startsWith(n)) {
2431
+ const i = e.replace(n, s);
2082
2432
  this.idToRemoteMap[i] = {
2083
2433
  name: r.name,
2084
- expose: n
2434
+ expose: o
2085
2435
  };
2086
2436
  return;
2087
2437
  }
2088
2438
  if (s && e.startsWith(s)) {
2089
- const i = e.replace(s, o);
2439
+ const i = e.replace(s, n);
2090
2440
  this.idToRemoteMap[i] = {
2091
2441
  name: r.name,
2092
- expose: n
2442
+ expose: o
2093
2443
  };
2094
2444
  }
2095
2445
  }
2096
2446
  async loadRemote(e, t) {
2097
- const { host: r } = this;
2447
+ const { host: r } = this, o = Ye(r.options.remotes, e);
2448
+ let n = e, s = o == null ? void 0 : o.expose, i = o ? q(o.remote) : void 0, c;
2098
2449
  try {
2099
- 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({
2100
- id: u,
2101
- pkgNameOrAlias: a,
2102
- expose: c,
2103
- exposeModule: n ? h : void 0,
2104
- exposeModuleFactory: n ? void 0 : h,
2105
- remote: l,
2106
- options: s,
2107
- moduleInstance: o,
2450
+ const { loadFactory: a = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo: f } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: d, remote: h, expose: m, id: p, remoteSnapshot: y } = f;
2451
+ n = p, s = m, i = q(h);
2452
+ const E = await l.get(p, m, t, y), _ = await this.hooks.lifecycle.onLoad.emit({
2453
+ id: p,
2454
+ pkgNameOrAlias: d,
2455
+ expose: m,
2456
+ exposeModule: a ? E : void 0,
2457
+ exposeModuleFactory: a ? void 0 : E,
2458
+ remote: h,
2459
+ options: u,
2460
+ moduleInstance: l,
2108
2461
  origin: r
2109
2462
  });
2110
- return this.setIdToRemoteMap(e, i), typeof f == "function" ? f : h;
2111
- } catch (n) {
2112
- const { from: o = "runtime" } = t || { from: "runtime" }, s = await this.hooks.lifecycle.errorLoadRemote.emit({
2113
- id: e,
2114
- error: n,
2115
- from: o,
2116
- lifecycle: "onLoad",
2463
+ return this.setIdToRemoteMap(e, f), c = {
2464
+ id: n,
2465
+ expose: s,
2466
+ remote: i,
2467
+ options: t,
2117
2468
  origin: r
2118
- });
2119
- if (!s) throw n;
2120
- return s;
2469
+ }, typeof _ == "function" ? _ : E;
2470
+ } catch (a) {
2471
+ const { from: l = "runtime" } = t || { from: "runtime" };
2472
+ let u;
2473
+ try {
2474
+ u = await this.hooks.lifecycle.errorLoadRemote.emit({
2475
+ id: e,
2476
+ error: a,
2477
+ from: l,
2478
+ lifecycle: "onLoad",
2479
+ expose: s,
2480
+ remote: i,
2481
+ origin: r
2482
+ });
2483
+ } catch (f) {
2484
+ throw c = {
2485
+ id: n,
2486
+ expose: s,
2487
+ remote: i,
2488
+ options: t,
2489
+ error: f,
2490
+ origin: r
2491
+ }, f;
2492
+ }
2493
+ if (!u)
2494
+ throw c = {
2495
+ id: n,
2496
+ expose: s,
2497
+ remote: i,
2498
+ options: t,
2499
+ error: a,
2500
+ origin: r
2501
+ }, a;
2502
+ return c = {
2503
+ id: n,
2504
+ expose: s,
2505
+ remote: i,
2506
+ options: t,
2507
+ error: a,
2508
+ origin: r,
2509
+ recovered: !0
2510
+ }, u;
2511
+ } finally {
2512
+ c && await this.hooks.lifecycle.afterLoadRemote.emit(c);
2121
2513
  }
2122
2514
  }
2123
2515
  async preloadRemote(e) {
2124
- const { host: t } = this;
2516
+ const { host: t } = this, r = [];
2125
2517
  await this.hooks.lifecycle.beforePreloadRemote.emit({
2126
2518
  preloadOps: e,
2127
2519
  options: t.options,
2128
2520
  origin: t
2129
2521
  });
2130
- const r = fn(t.options.remotes, e);
2131
- await Promise.all(r.map(async (n) => {
2132
- const { remote: o } = n, s = ye(o), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: o }), l = await this.hooks.lifecycle.generatePreloadAssets.emit({
2133
- origin: t,
2134
- preloadOptions: n,
2135
- remote: o,
2136
- remoteInfo: s,
2137
- globalSnapshot: i,
2138
- remoteSnapshot: a
2139
- });
2140
- l && At(s, t, l);
2522
+ const o = _o(t.options.remotes, e), n = (c) => {
2523
+ const { preloadConfig: a, remote: l } = c, u = a.exposes || [];
2524
+ return u.length ? u.map((f) => ({
2525
+ ops: {
2526
+ ...c,
2527
+ preloadConfig: {
2528
+ ...a,
2529
+ exposes: [f]
2530
+ }
2531
+ },
2532
+ id: xe(l.name, f)
2533
+ })) : [{
2534
+ ops: c,
2535
+ id: `${l.name}/*`
2536
+ }];
2537
+ };
2538
+ let s;
2539
+ await Promise.all(o.flatMap(n).map(async (c) => {
2540
+ const { ops: a, id: l } = c, { remote: u, preloadConfig: f } = a, d = q(u);
2541
+ try {
2542
+ const { globalSnapshot: h, remoteSnapshot: m } = await t.snapshotHandler.loadRemoteSnapshotInfo({
2543
+ moduleInfo: u,
2544
+ id: l,
2545
+ initiator: "preloadRemote"
2546
+ }), p = await this.hooks.lifecycle.generatePreloadAssets.emit({
2547
+ origin: t,
2548
+ preloadOptions: a,
2549
+ remote: u,
2550
+ remoteInfo: d,
2551
+ globalSnapshot: h,
2552
+ remoteSnapshot: m
2553
+ });
2554
+ if (!p) return;
2555
+ const y = await Ht(d, t, p, !0, {
2556
+ initiator: "preloadRemote",
2557
+ id: l
2558
+ });
2559
+ r.push({
2560
+ remote: u,
2561
+ remoteInfo: d,
2562
+ preloadConfig: f,
2563
+ id: l,
2564
+ results: y
2565
+ });
2566
+ } catch (h) {
2567
+ r.push({
2568
+ remote: u,
2569
+ remoteInfo: d,
2570
+ preloadConfig: f,
2571
+ id: l,
2572
+ results: [{
2573
+ url: d.entry,
2574
+ status: "error",
2575
+ resourceType: /\.json(?:$|[?#])/i.test(d.entry) ? "manifest" : "remoteEntry",
2576
+ initiator: "preloadRemote",
2577
+ id: l,
2578
+ error: h
2579
+ }]
2580
+ });
2581
+ }
2141
2582
  }));
2583
+ const i = r.flatMap((c) => c.results.filter((a) => a.status === "error" || a.status === "timeout"));
2584
+ if (i.length > 0 && (s = /* @__PURE__ */ new Error(`preloadRemote failed to load ${i.length} resource(s).`), Object.assign(s, {
2585
+ results: r,
2586
+ failedResults: i
2587
+ })), await this.hooks.lifecycle.afterPreloadRemote.emit({
2588
+ preloadOps: e,
2589
+ options: t.options,
2590
+ origin: t,
2591
+ results: r,
2592
+ error: s
2593
+ }), s) throw s;
2142
2594
  }
2143
2595
  registerRemotes(e, t) {
2144
2596
  const { host: r } = this;
2145
- e.forEach((n) => {
2146
- this.registerRemote(n, r.options.remotes, { force: t == null ? void 0 : t.force });
2597
+ e.forEach((o) => {
2598
+ this.registerRemote(o, r.options.remotes, { force: t == null ? void 0 : t.force });
2147
2599
  });
2148
2600
  }
2149
2601
  async getRemoteModuleAndOptions(e) {
2150
2602
  const { host: t } = this, { id: r } = e;
2151
- let n;
2603
+ let o;
2152
2604
  try {
2153
- n = await this.hooks.lifecycle.beforeRequest.emit({
2605
+ o = await this.hooks.lifecycle.beforeRequest.emit({
2154
2606
  id: r,
2155
2607
  options: t.options,
2156
2608
  origin: t
2157
2609
  });
2158
- } catch (f) {
2159
- if (n = await this.hooks.lifecycle.errorLoadRemote.emit({
2610
+ } catch (h) {
2611
+ if (o = await this.hooks.lifecycle.errorLoadRemote.emit({
2160
2612
  id: r,
2161
2613
  options: t.options,
2162
2614
  origin: t,
2163
2615
  from: "runtime",
2164
- error: f,
2616
+ error: h,
2165
2617
  lifecycle: "beforeRequest"
2166
- }), !n) throw f;
2618
+ }), !o) throw h;
2619
+ }
2620
+ const { id: n } = o, s = Ye(t.options.remotes, n);
2621
+ if (!s) try {
2622
+ b(Nt, k, {
2623
+ hostName: t.options.name,
2624
+ requestId: n
2625
+ }, void 0, F(t.options));
2626
+ } catch (h) {
2627
+ throw await this.hooks.lifecycle.afterMatchRemote.emit({
2628
+ id: n,
2629
+ options: t.options,
2630
+ error: h,
2631
+ origin: t
2632
+ }), h;
2167
2633
  }
2168
- const { id: o } = n, s = Zr(t.options.remotes, o);
2169
- s || $(Rt, O, {
2170
- hostName: t.options.name,
2171
- requestId: o
2172
- }, void 0, z(t.options));
2173
- const { remote: i } = s, a = ye(i), l = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
2174
- id: o,
2634
+ const { remote: i } = s, c = q(i);
2635
+ await this.hooks.lifecycle.afterMatchRemote.emit({
2636
+ id: n,
2637
+ ...s,
2638
+ options: t.options,
2639
+ remoteInfo: c,
2640
+ origin: t
2641
+ });
2642
+ const a = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
2643
+ id: n,
2175
2644
  ...s,
2176
2645
  options: t.options,
2177
2646
  origin: t,
2178
- remoteInfo: a
2179
- }), { remote: c, expose: u } = l;
2180
- P(c && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);
2181
- let d = t.moduleCache.get(c.name);
2182
- const h = {
2647
+ remoteInfo: c
2648
+ }), { remote: l, expose: u } = a;
2649
+ O(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);
2650
+ let f = t.moduleCache.get(l.name);
2651
+ const d = {
2183
2652
  host: t,
2184
- remoteInfo: a
2653
+ remoteInfo: c
2185
2654
  };
2186
- return d || (d = new Pt(h), t.moduleCache.set(c.name, d)), {
2187
- module: d,
2188
- moduleOptions: h,
2189
- remoteMatchInfo: l
2655
+ return f || (f = new Dt(d), t.moduleCache.set(l.name, f)), {
2656
+ module: f,
2657
+ moduleOptions: d,
2658
+ remoteMatchInfo: a
2190
2659
  };
2191
2660
  }
2192
2661
  registerRemote(e, t, r) {
2193
- const { host: n } = this, o = () => {
2662
+ const { host: o } = this, n = () => {
2194
2663
  if (e.alias) {
2195
- const i = t.find((a) => {
2196
- var l;
2197
- return e.alias && (a.name.startsWith(e.alias) || ((l = a.alias) == null ? void 0 : l.startsWith(e.alias)));
2664
+ const i = t.find((c) => {
2665
+ var a;
2666
+ return e.alias && (c.name.startsWith(e.alias) || ((a = c.alias) == null ? void 0 : a.startsWith(e.alias)));
2198
2667
  });
2199
- P(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2668
+ O(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
2200
2669
  }
2201
- "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);
2670
+ "entry" in e && D && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = se), e.type || (e.type = Rt);
2202
2671
  };
2203
2672
  this.hooks.lifecycle.beforeRegisterRemote.emit({
2204
2673
  remote: e,
2205
- origin: n
2674
+ origin: o
2206
2675
  });
2207
2676
  const s = t.find((i) => i.name === e.name);
2208
2677
  if (!s)
2209
- o(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2678
+ n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2210
2679
  remote: e,
2211
- origin: n
2680
+ origin: o
2212
2681
  });
2213
2682
  else {
2214
2683
  const i = [`The remote "${e.name}" is already registered.`, "Please note that overriding it may cause unexpected errors."];
2215
- r != null && r.force && (this.removeRemote(s), o(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2684
+ r != null && r.force && (this.removeRemote(s), n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
2216
2685
  remote: e,
2217
- origin: n
2218
- }), Ye(i.join(" ")));
2686
+ origin: o
2687
+ }), rt(i.join(" ")));
2219
2688
  }
2220
2689
  }
2221
2690
  removeRemote(e) {
2222
2691
  var t;
2223
2692
  try {
2224
- const { host: r } = this, { name: n } = e, o = r.options.remotes.findIndex((i) => i.name === n);
2225
- o !== -1 && r.options.remotes.splice(o, 1);
2693
+ const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((i) => i.name === o);
2694
+ n !== -1 && r.options.remotes.splice(n, 1);
2226
2695
  const s = r.moduleCache.get(e.name);
2227
2696
  if (s) {
2228
- const i = s.remoteInfo, a = i.entryGlobalName;
2229
- I[a] && ((t = Object.getOwnPropertyDescriptor(I, a)) != null && t.configurable ? delete I[a] : I[a] = void 0);
2230
- const l = ke(s.remoteInfo);
2231
- V[l] && delete V[l], r.snapshotHandler.manifestCache.delete(i.entry);
2232
- let c = i.buildVersion ? Xe(i.name, i.buildVersion) : i.name;
2233
- const u = I.__FEDERATION__.__INSTANCES__.findIndex((h) => i.buildVersion ? h.options.id === c : h.name === c);
2697
+ const i = s.remoteInfo, c = i.entryGlobalName;
2698
+ N[c] && ((t = Object.getOwnPropertyDescriptor(N, c)) != null && t.configurable ? delete N[c] : N[c] = void 0);
2699
+ const a = Me(s.remoteInfo);
2700
+ j[a] && delete j[a], r.snapshotHandler.manifestCache.delete(i.entry);
2701
+ let l = i.buildVersion ? tt(i.name, i.buildVersion) : i.name;
2702
+ const u = N.__FEDERATION__.__INSTANCES__.findIndex((d) => i.buildVersion ? d.options.id === l : d.name === l);
2234
2703
  if (u !== -1) {
2235
- const h = I.__FEDERATION__.__INSTANCES__[u];
2236
- c = h.options.id || c;
2237
- const f = gt();
2238
- let p = !0;
2239
- const m = [];
2240
- Object.keys(f).forEach((g) => {
2241
- const y = f[g];
2242
- y && Object.keys(y).forEach((_) => {
2243
- const b = y[_];
2244
- b && Object.keys(b).forEach((R) => {
2245
- const E = b[R];
2246
- E && Object.keys(E).forEach((w) => {
2247
- const S = E[w];
2248
- S && typeof S == "object" && S.from === i.name && (S.loaded || S.loading ? (S.useIn = S.useIn.filter((N) => N !== i.name), S.useIn.length ? p = !1 : m.push([
2249
- g,
2704
+ const d = N.__FEDERATION__.__INSTANCES__[u];
2705
+ l = d.options.id || l;
2706
+ const h = St();
2707
+ let m = !0;
2708
+ const p = [];
2709
+ Object.keys(h).forEach((y) => {
2710
+ const E = h[y];
2711
+ E && Object.keys(E).forEach((_) => {
2712
+ const g = E[_];
2713
+ g && Object.keys(g).forEach((R) => {
2714
+ const w = g[R];
2715
+ w && Object.keys(w).forEach(($) => {
2716
+ const S = w[$];
2717
+ S && typeof S == "object" && S.from === i.name && (S.loaded || S.loading ? (S.useIn = S.useIn.filter((v) => v !== i.name), S.useIn.length ? m = !1 : p.push([
2718
+ y,
2250
2719
  _,
2251
2720
  R,
2252
- w
2253
- ])) : m.push([
2254
- g,
2721
+ $
2722
+ ])) : p.push([
2723
+ y,
2255
2724
  _,
2256
2725
  R,
2257
- w
2726
+ $
2258
2727
  ]));
2259
2728
  });
2260
2729
  });
2261
2730
  });
2262
- }), p && (h.shareScopeMap = {}, delete f[c]), m.forEach(([g, y, _, b]) => {
2263
- var R, E, w;
2264
- (w = (E = (R = f[g]) == null ? void 0 : R[y]) == null ? void 0 : E[_]) == null || delete w[b];
2265
- }), I.__FEDERATION__.__INSTANCES__.splice(u, 1);
2731
+ }), m && (d.shareScopeMap = {}, delete h[l]), p.forEach(([y, E, _, g]) => {
2732
+ var R, w, $;
2733
+ ($ = (w = (R = h[y]) == null ? void 0 : R[E]) == null ? void 0 : w[_]) == null || delete $[g];
2734
+ }), N.__FEDERATION__.__INSTANCES__.splice(u, 1);
2266
2735
  }
2267
- const { hostGlobalSnapshot: d } = Mt(e, r);
2268
- if (d) {
2269
- const h = d && "remotesInfo" in d && d.remotesInfo && q(d.remotesInfo, e.name).key;
2270
- h && (delete d.remotesInfo[h], Q.__FEDERATION__.__MANIFEST_LOADING__[h] && delete Q.__FEDERATION__.__MANIFEST_LOADING__[h]);
2736
+ const { hostGlobalSnapshot: f } = Bt(e, r);
2737
+ if (f) {
2738
+ const d = f && "remotesInfo" in f && f.remotesInfo && J(f.remotesInfo, e.name).key;
2739
+ d && (delete f.remotesInfo[d], re.__FEDERATION__.__MANIFEST_LOADING__[d] && delete re.__FEDERATION__.__MANIFEST_LOADING__[d]);
2271
2740
  }
2272
2741
  r.moduleCache.delete(e.name);
2273
2742
  }
2274
2743
  } catch (r) {
2275
- Ae.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
2744
+ Pe.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
2276
2745
  }
2277
2746
  }
2278
2747
  };
2279
- const Rn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2280
- var Sn = class {
2748
+ const Lo = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
2749
+ var Mo = class {
2281
2750
  constructor(e) {
2282
- this.hooks = new j({
2283
- beforeInit: new W("beforeInit"),
2284
- init: new v(),
2285
- beforeInitContainer: new D("beforeInitContainer"),
2286
- initContainer: new D("initContainer")
2287
- }), this.version = "2.3.3", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
2288
- getModuleInfo: new v(),
2289
- createScript: new v(),
2290
- createLink: new v(),
2291
- fetch: new A(),
2292
- loadEntryError: new A(),
2293
- getModuleFactory: new A()
2294
- }), this.bridgeHook = new j({
2295
- beforeBridgeRender: new v(),
2296
- afterBridgeRender: new v(),
2297
- beforeBridgeDestroy: new v(),
2298
- afterBridgeDestroy: new v()
2751
+ this.hooks = new z({
2752
+ beforeInit: new K("beforeInit"),
2753
+ init: new A(),
2754
+ beforeInitContainer: new H("beforeInitContainer"),
2755
+ initContainer: new H("initContainer")
2756
+ }), this.version = "2.5.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new z({
2757
+ getModuleInfo: new A(),
2758
+ createScript: new A(),
2759
+ createLink: new A(),
2760
+ fetch: new I(),
2761
+ loadEntryError: new I(),
2762
+ afterLoadEntry: new I("afterLoadEntry"),
2763
+ beforeInitRemote: new I("beforeInitRemote"),
2764
+ afterInitRemote: new I("afterInitRemote"),
2765
+ beforeGetExpose: new I("beforeGetExpose"),
2766
+ afterGetExpose: new I("afterGetExpose"),
2767
+ beforeExecuteFactory: new I("beforeExecuteFactory"),
2768
+ afterExecuteFactory: new I("afterExecuteFactory"),
2769
+ getModuleFactory: new I()
2770
+ }), this.bridgeHook = new z({
2771
+ beforeBridgeRender: new A(),
2772
+ afterBridgeRender: new A(),
2773
+ beforeBridgeDestroy: new A(),
2774
+ afterBridgeDestroy: new A()
2299
2775
  });
2300
- const t = Rn ? [pn(), gn()] : [], r = {
2301
- id: cn(),
2776
+ const t = Lo ? [Io(), vo()] : [], r = {
2777
+ id: yo(),
2302
2778
  name: e.name,
2303
2779
  plugins: t,
2304
2780
  remotes: [],
2305
2781
  shared: {},
2306
- inBrowser: F
2782
+ inBrowser: D
2307
2783
  };
2308
- 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);
2784
+ this.name = e.name, this.options = r, this.snapshotHandler = new Ao(this), this.sharedHandler = new ko(this), this.remoteHandler = new Po(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
2309
2785
  }
2310
2786
  initOptions(e) {
2311
- e.name && e.name !== this.options.name && $(st(wt, O)), this.registerPlugins(e.plugins);
2787
+ e.name && e.name !== this.options.name && b(ut(At, k)), this.registerPlugins(e.plugins);
2312
2788
  const t = this.formatOptions(this.options, e);
2313
2789
  return this.options = t, t;
2314
2790
  }
@@ -2318,18 +2794,18 @@ var Sn = class {
2318
2794
  loadShareSync(e, t) {
2319
2795
  return this.sharedHandler.loadShareSync(e, t);
2320
2796
  }
2321
- initializeSharing(e = re, t) {
2797
+ initializeSharing(e = se, t) {
2322
2798
  return this.sharedHandler.initializeSharing(e, t);
2323
2799
  }
2324
2800
  initRawContainer(e, t, r) {
2325
- const n = ye({
2801
+ const o = q({
2326
2802
  name: e,
2327
2803
  entry: t
2328
- }), o = new Pt({
2804
+ }), n = new Dt({
2329
2805
  host: this,
2330
- remoteInfo: n
2806
+ remoteInfo: o
2331
2807
  });
2332
- return o.remoteEntryExports = r, this.moduleCache.set(e, o), o;
2808
+ return n.remoteEntryExports = r, this.moduleCache.set(e, n), n;
2333
2809
  }
2334
2810
  async loadRemote(e, t) {
2335
2811
  return this.remoteHandler.loadRemote(e, t);
@@ -2341,30 +2817,31 @@ var Sn = class {
2341
2817
  this.sharedHandler.initShareScopeMap(e, t, r);
2342
2818
  }
2343
2819
  formatOptions(e, t) {
2344
- const { allShareInfos: r } = yt(e, t), { userOptions: n, options: o } = this.hooks.lifecycle.beforeInit.emit({
2820
+ const { allShareInfos: r } = bt(e, t), { userOptions: o, options: n } = this.hooks.lifecycle.beforeInit.emit({
2345
2821
  origin: this,
2346
2822
  userOptions: t,
2347
2823
  options: e,
2348
2824
  shareInfo: r
2349
- }), s = this.remoteHandler.formatAndRegisterRemote(o, n), { allShareInfos: i } = this.sharedHandler.registerShared(o, n), a = [...o.plugins];
2350
- n.plugins && n.plugins.forEach((c) => {
2351
- a.includes(c) || a.push(c);
2825
+ }), s = this.remoteHandler.formatAndRegisterRemote(n, o), { allShareInfos: i } = this.sharedHandler.registerShared(n, o), c = [...n.plugins];
2826
+ o.plugins && o.plugins.forEach((l) => {
2827
+ c.includes(l) || c.push(l);
2352
2828
  });
2353
- const l = {
2829
+ const a = {
2354
2830
  ...e,
2355
2831
  ...t,
2356
- plugins: a,
2832
+ plugins: c,
2357
2833
  remotes: s,
2358
- shared: i
2834
+ shared: i,
2835
+ id: o.id || e.id
2359
2836
  };
2360
2837
  return this.hooks.lifecycle.init.emit({
2361
2838
  origin: this,
2362
- options: l
2363
- }), l;
2839
+ options: a
2840
+ }), a;
2364
2841
  }
2365
2842
  registerPlugins(e) {
2366
- const t = ln(e, this);
2367
- this.options.plugins = this.options.plugins.reduce((r, n) => (n && r && !r.find((o) => o.name === n.name) && r.push(n), r), t || []);
2843
+ const t = Eo(e, this);
2844
+ this.options.plugins = this.options.plugins.reduce((r, o) => (o && r && !r.find((n) => n.name === o.name) && r.push(o), r), t || []);
2368
2845
  }
2369
2846
  registerRemotes(e, t) {
2370
2847
  return this.remoteHandler.registerRemotes(e, t);
@@ -2376,127 +2853,128 @@ var Sn = class {
2376
2853
  });
2377
2854
  }
2378
2855
  };
2379
- let $n = null;
2380
- function Ct() {
2381
- return $n;
2382
- }
2383
- pr(Sn);
2384
- function Dt(e, t) {
2385
- const r = (n) => {
2386
- if (!n.startsWith("/")) return n;
2387
- const o = n.length > 1 && n.endsWith("/"), s = `${t}/${n}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
2388
- return o ? `${s}/` : s;
2856
+ let Oo = null;
2857
+ function Vt(e) {
2858
+ return Oo;
2859
+ }
2860
+ wr(Mo);
2861
+ function Wt(e, t) {
2862
+ const r = (o) => {
2863
+ if (!o.startsWith("/")) return o;
2864
+ const n = o.length > 1 && o.endsWith("/"), s = `${t}/${o}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
2865
+ return n ? `${s}/` : s;
2389
2866
  };
2390
- return e.map((n) => {
2391
- const o = {
2392
- ...n,
2393
- path: r(n.path)
2867
+ return e.map((o) => {
2868
+ const n = {
2869
+ ...o,
2870
+ path: r(o.path)
2394
2871
  };
2395
- return typeof n.redirect == "string" ? o.redirect = r(n.redirect) : n.redirect && typeof n.redirect == "object" && "path" in n.redirect && typeof n.redirect.path == "string" && (o.redirect = {
2396
- ...n.redirect,
2397
- path: r(n.redirect.path)
2398
- }), n.children && n.children.length > 0 && (o.children = Dt(
2399
- n.children,
2872
+ return typeof o.redirect == "string" ? n.redirect = r(o.redirect) : o.redirect && typeof o.redirect == "object" && "path" in o.redirect && typeof o.redirect.path == "string" && (n.redirect = {
2873
+ ...o.redirect,
2874
+ path: r(o.redirect.path)
2875
+ }), o.children && o.children.length > 0 && (n.children = Wt(
2876
+ o.children,
2400
2877
  t
2401
- )), o;
2878
+ )), n;
2402
2879
  });
2403
2880
  }
2404
- function wn(e) {
2405
- 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;
2881
+ function Co(e) {
2882
+ const t = e.replace(/\/+$/, ""), r = (s) => s.startsWith("/") && s !== t && !s.startsWith(t + "/"), o = (s) => `${t}${s}`.replace(/\/+/g, "/"), n = (s) => typeof s == "string" ? r(s) ? o(s) : s : "path" in s && typeof s.path == "string" && r(s.path) ? { ...s, path: o(s.path) } : s;
2406
2883
  return (s) => {
2407
- const i = s.push.bind(s), a = s.replace.bind(s), l = s.resolve.bind(s);
2408
- s.push = (c) => i(o(c)), s.replace = (c) => a(o(c)), s.resolve = (c, ...u) => l(o(c), ...u);
2884
+ const i = s.push.bind(s), c = s.replace.bind(s), a = s.resolve.bind(s);
2885
+ s.push = (l) => i(n(l)), s.replace = (l) => c(n(l)), s.resolve = (l, ...u) => a(n(l), ...u);
2409
2886
  };
2410
2887
  }
2411
- function Nn(e) {
2412
- const { router: t, basename: r, memoryRoute: n, hashRoute: o } = e, s = t.getRoutes().sort(
2413
- (f, p) => f.path.split("/").filter((m) => m).length - p.path.split("/").filter((m) => m).length
2414
- ), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
2415
- s.forEach((f) => {
2416
- const p = i.get(f.path) || [];
2417
- p.push(f), i.set(f.path, p);
2888
+ function Fo(e) {
2889
+ const { router: t, basename: r, memoryRoute: o, hashRoute: n } = e, s = t.getRoutes().sort(
2890
+ (h, m) => h.path.split("/").filter((p) => p).length - m.path.split("/").filter((p) => p).length
2891
+ ), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
2892
+ s.forEach((h) => {
2893
+ const m = i.get(h.path) || [];
2894
+ m.push(h), i.set(h.path, m);
2418
2895
  });
2419
- const l = (f, p) => `${f}/${p}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", c = (f, p = "") => {
2420
- if (!f.children || f.children.length === 0)
2421
- return f;
2422
- for (let m = 0; m < f.children.length; m++) {
2423
- const g = f.children[m], y = l(p, g.path), b = (i.get(y) || []).find(
2424
- (R) => !a.has(R) && R !== f && (g.name == null || R.name === g.name)
2896
+ const a = (h, m) => `${h}/${m}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (h, m = "") => {
2897
+ if (!h.children || h.children.length === 0)
2898
+ return h;
2899
+ for (let p = 0; p < h.children.length; p++) {
2900
+ const y = h.children[p], E = a(m, y.path), g = (i.get(E) || []).find(
2901
+ (R) => !c.has(R) && R !== h && (y.name == null || R.name === y.name)
2425
2902
  );
2426
- if (b) {
2903
+ if (g) {
2427
2904
  const R = {
2428
- ...b,
2429
- path: g.path
2905
+ ...g,
2906
+ path: y.path
2430
2907
  // Keep the original relative path from static route
2431
2908
  };
2432
- f.children[m] = R, a.add(b), c(R, y);
2909
+ h.children[p] = R, c.add(g), l(R, E);
2433
2910
  }
2434
2911
  }
2435
- return f;
2912
+ return h;
2436
2913
  };
2437
2914
  let u = [];
2438
- for (const f of s)
2439
- if (!a.has(f)) {
2440
- const p = c(f, f.path);
2441
- a.add(f), u.push(p);
2915
+ for (const h of s)
2916
+ if (!c.has(h)) {
2917
+ const m = l(h, h.path);
2918
+ c.add(h), u.push(m);
2442
2919
  }
2443
- let d, h;
2444
- 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 };
2920
+ let f, d;
2921
+ return o ? f = le.createMemoryHistory(r) : n ? (f = le.createWebHashHistory(), r && (u = Wt(u, r), d = Co(r))) : f = le.createWebHistory(r), { history: f, routes: u, patchRouter: d };
2445
2922
  }
2446
- function kn(e) {
2447
- const t = /* @__PURE__ */ new Map(), r = Ct();
2923
+ function Bo(e) {
2924
+ const t = /* @__PURE__ */ new Map(), r = Vt();
2448
2925
  return () => ({
2449
- __APP_VERSION__: "2.3.3",
2450
- async render(n) {
2451
- var p, m, g;
2452
- C.debug("createBridgeComponent render Info", n);
2926
+ __APP_VERSION__: "2.5.0",
2927
+ async render(o) {
2928
+ var m, p, y, E, _, g;
2929
+ C.debug("createBridgeComponent render Info", o);
2453
2930
  const {
2454
- moduleName: o,
2931
+ moduleName: n,
2455
2932
  dom: s,
2456
2933
  basename: i,
2457
- memoryRoute: a,
2458
- hashRoute: l,
2459
- ...c
2460
- } = n, u = Ft.createApp(e.rootComponent, c);
2934
+ memoryRoute: c,
2935
+ hashRoute: a,
2936
+ ...l
2937
+ } = o, u = jt.createApp(e.rootComponent, l);
2461
2938
  t.set(s, u);
2462
- 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({
2939
+ const f = await ((y = (p = (m = r == null ? void 0 : r.bridgeHook) == null ? void 0 : m.lifecycle) == null ? void 0 : p.beforeBridgeRender) == null ? void 0 : y.emit(o)), d = f && typeof f == "object" && (f != null && f.extraProps) ? f == null ? void 0 : f.extraProps : {}, h = e.appOptions({
2463
2940
  app: u,
2464
2941
  basename: i,
2465
- memoryRoute: a,
2466
- hashRoute: l,
2467
- ...c,
2468
- ...h
2942
+ memoryRoute: c,
2943
+ hashRoute: a,
2944
+ ...l,
2945
+ ...d
2469
2946
  });
2470
- if (f != null && f.router) {
2471
- const { history: y, routes: _, patchRouter: b } = Nn({
2472
- router: f.router,
2473
- basename: n.basename,
2474
- memoryRoute: n.memoryRoute,
2475
- hashRoute: n.hashRoute
2476
- }), R = ae.createRouter({
2477
- ...f.router.options,
2478
- history: y,
2479
- routes: _
2947
+ if (h != null && h.router) {
2948
+ const { history: R, routes: w, patchRouter: $ } = Fo({
2949
+ router: h.router,
2950
+ basename: o.basename,
2951
+ memoryRoute: o.memoryRoute,
2952
+ hashRoute: o.hashRoute
2953
+ }), S = le.createRouter({
2954
+ ...h.router.options,
2955
+ history: R,
2956
+ routes: w
2480
2957
  });
2481
- b && b(R), f.afterRouterCreate && f.afterRouterCreate(R), C.debug("createBridgeComponent render router info>>>", {
2482
- moduleName: o,
2483
- router: R
2484
- }), a && await R.push(a.entryPath), u.use(R);
2958
+ $ && $(S), h.afterRouterCreate && h.afterRouterCreate(S), C.debug("createBridgeComponent render router info>>>", {
2959
+ moduleName: n,
2960
+ router: S
2961
+ }), c && await S.push(c.entryPath), u.use(S);
2485
2962
  }
2486
- u.mount(s);
2963
+ u.mount(s), (g = (_ = (E = r == null ? void 0 : r.bridgeHook) == null ? void 0 : E.lifecycle) == null ? void 0 : _.afterBridgeRender) == null || g.emit(o);
2487
2964
  },
2488
- destroy(n) {
2489
- C.debug("createBridgeComponent destroy Info", n);
2490
- const o = t.get(n == null ? void 0 : n.dom);
2491
- o == null || o.unmount();
2965
+ destroy(o) {
2966
+ var s, i, c, a, l, u;
2967
+ C.debug("createBridgeComponent destroy Info", o);
2968
+ const n = t.get(o == null ? void 0 : o.dom);
2969
+ (c = (i = (s = r == null ? void 0 : r.bridgeHook) == null ? void 0 : s.lifecycle) == null ? void 0 : i.beforeBridgeDestroy) == null || c.emit(o), n == null || n.unmount(), (u = (l = (a = r == null ? void 0 : r.bridgeHook) == null ? void 0 : a.lifecycle) == null ? void 0 : l.afterBridgeDestroy) == null || u.emit(o);
2492
2970
  }
2493
2971
  });
2494
2972
  }
2495
- function In() {
2973
+ function Ho() {
2496
2974
  const e = new PopStateEvent("popstate", { state: window.history.state });
2497
2975
  window.dispatchEvent(e);
2498
2976
  }
2499
- const Tn = /* @__PURE__ */ Ht({
2977
+ const Do = /* @__PURE__ */ qt({
2500
2978
  name: "RemoteApp",
2501
2979
  props: {
2502
2980
  moduleName: String,
@@ -2508,10 +2986,10 @@ const Tn = /* @__PURE__ */ Ht({
2508
2986
  },
2509
2987
  inheritAttrs: !1,
2510
2988
  setup(e) {
2511
- const t = Ee(null), r = Ee(null), n = Ee(""), o = Ke(), s = Ct(), i = Gt(), a = async () => {
2512
- var h, f, p, m;
2513
- const c = (h = e.providerInfo) == null ? void 0 : h.call(e);
2514
- r.value = c;
2989
+ const t = _e(null), r = _e(null), o = _e(""), n = Ze(), s = Vt(), i = Kt(), c = async () => {
2990
+ var d, h, m, p, y, E, _;
2991
+ const l = (d = e.providerInfo) == null ? void 0 : d.call(e);
2992
+ r.value = l;
2515
2993
  let u = {
2516
2994
  ...i,
2517
2995
  moduleName: e.moduleName,
@@ -2521,43 +2999,55 @@ const Tn = /* @__PURE__ */ Ht({
2521
2999
  hashRoute: e.hashRoute
2522
3000
  };
2523
3001
  C.debug("createRemoteAppComponent LazyComponent render >>>", u);
2524
- 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)) || {};
3002
+ const f = await ((p = (m = (h = s == null ? void 0 : s.bridgeHook) == null ? void 0 : h.lifecycle) == null ? void 0 : m.beforeBridgeRender) == null ? void 0 : p.emit(u)) || {};
2525
3003
  u = {
2526
3004
  ...u,
2527
- ...d.extraProps
2528
- }, c.render(u);
2529
- }, l = xt(() => o == null ? void 0 : o.path, (c) => {
2530
- c !== o.path && a(), n.value !== "" && n.value !== c && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
3005
+ ...f.extraProps
3006
+ }, l.render(u), (_ = (E = (y = s == null ? void 0 : s.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : E.afterBridgeRender) == null || _.emit(u);
3007
+ }, a = zt(() => n == null ? void 0 : n.path, (l) => {
3008
+ l !== n.path && c(), o.value !== "" && o.value !== l && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
2531
3009
  ...e,
2532
- pathname: o.path
2533
- }), In()), n.value = c;
3010
+ pathname: n.path
3011
+ }), Ho()), o.value = l;
2534
3012
  });
2535
- return Ut(() => {
2536
- a();
2537
- }), Bt(() => {
2538
- var c;
3013
+ return Jt(() => {
3014
+ c();
3015
+ }), Xt(() => {
3016
+ var l, u, f, d, h, m, p;
2539
3017
  C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
2540
3018
  ...e
2541
- }), l(), (c = r.value) == null || c.destroy({
3019
+ }), a(), (f = (u = (l = s == null ? void 0 : s.bridgeHook) == null ? void 0 : l.lifecycle) == null ? void 0 : u.beforeBridgeDestroy) == null || f.emit({
3020
+ name: e.moduleName,
3021
+ dom: t.value,
3022
+ basename: e.basename,
3023
+ memoryRoute: e.memoryRoute,
3024
+ hashRoute: e.hashRoute
3025
+ }), (d = r.value) == null || d.destroy({
2542
3026
  dom: t.value
3027
+ }), (p = (m = (h = s == null ? void 0 : s.bridgeHook) == null ? void 0 : h.lifecycle) == null ? void 0 : m.afterBridgeDestroy) == null || p.emit({
3028
+ name: e.moduleName,
3029
+ dom: t.value,
3030
+ basename: e.basename,
3031
+ memoryRoute: e.memoryRoute,
3032
+ hashRoute: e.hashRoute
2543
3033
  });
2544
- }), () => Vt("div", Wt(e.rootAttrs || {}, {
3034
+ }), () => Yt("div", Zt(e.rootAttrs || {}, {
2545
3035
  ref: t
2546
3036
  }), null);
2547
3037
  }
2548
3038
  });
2549
- function vn(e) {
2550
- return jt({
2551
- __APP_VERSION__: "2.3.3",
3039
+ function xo(e) {
3040
+ return Qt({
3041
+ __APP_VERSION__: "2.5.0",
2552
3042
  ...e.asyncComponentOptions,
2553
3043
  //@ts-ignore
2554
3044
  loader: async () => {
2555
- var l, c;
2556
- const t = Ke();
3045
+ var a, l;
3046
+ const t = Ze();
2557
3047
  let r = "/";
2558
- const n = (c = (l = t == null ? void 0 : t.matched) == null ? void 0 : l[0]) == null ? void 0 : c.path;
2559
- n && (n.endsWith("/:pathMatch(.*)*") ? r = n.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
2560
- const o = (e == null ? void 0 : e.export) || "default";
3048
+ const o = (l = (a = t == null ? void 0 : t.matched) == null ? void 0 : a[0]) == null ? void 0 : l.path;
3049
+ o && (o.endsWith("/:pathMatch(.*)*") ? r = o.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
3050
+ const n = (e == null ? void 0 : e.export) || "default";
2561
3051
  C.debug(
2562
3052
  "createRemoteAppComponent LazyComponent create >>>",
2563
3053
  {
@@ -2565,16 +3055,16 @@ function vn(e) {
2565
3055
  info: e
2566
3056
  }
2567
3057
  );
2568
- const s = await e.loader(), i = s && s[Symbol.for("mf_module_id")], a = s[o];
3058
+ const s = await e.loader(), i = s && s[Symbol.for("mf_module_id")], c = s[n];
2569
3059
  if (C.debug(
2570
3060
  "createRemoteAppComponent LazyComponent loadRemote info >>>",
2571
- { moduleName: i, module: s, exportName: o, basename: r, route: t }
2572
- ), o in s && typeof a == "function")
3061
+ { moduleName: i, module: s, exportName: n, basename: r, route: t }
3062
+ ), n in s && typeof c == "function")
2573
3063
  return {
2574
3064
  render() {
2575
- return qt(Tn, {
3065
+ return er(Do, {
2576
3066
  moduleName: i,
2577
- providerInfo: a,
3067
+ providerInfo: c,
2578
3068
  basename: r,
2579
3069
  rootAttrs: e.rootAttrs,
2580
3070
  memoryRoute: e.memoryRoute,
@@ -2586,13 +3076,13 @@ function vn(e) {
2586
3076
  }
2587
3077
  });
2588
3078
  }
2589
- function On(e) {
3079
+ function Vo(e) {
2590
3080
  return C.warn(
2591
3081
  "createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
2592
- ), vn(e);
3082
+ ), xo(e);
2593
3083
  }
2594
3084
  export {
2595
- kn as createBridgeComponent,
2596
- vn as createRemoteAppComponent,
2597
- On as createRemoteComponent
3085
+ Bo as createBridgeComponent,
3086
+ xo as createRemoteAppComponent,
3087
+ Vo as createRemoteComponent
2598
3088
  };