@camstack/addon-benchmark 1.2.97 → 1.2.100

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