@camstack/addon-tailscale-client 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@mf-types/compiled-types/page/TailscaleClientOverviewPage.d.ts +20 -0
- package/dist/@mf-types/compiled-types/page/TailscaleClientOverviewPage.d.ts.map +1 -0
- package/dist/@mf-types/compiled-types/page/page.d.ts +8 -0
- package/dist/@mf-types/compiled-types/page/page.d.ts.map +1 -0
- package/dist/@mf-types/page.d.ts +2 -0
- package/dist/@mf-types.d.ts +3 -0
- package/dist/@mf-types.zip +0 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-bYM9BuS1.mjs +12 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-CtHD1dC0.mjs +12 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.mjs-fz-lQtUx.mjs +12 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-B-3nffMn.mjs +73 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-6CvhJC3f.mjs +42 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-Sv3rXvki.mjs +46 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react__loadShare__.mjs-BBqTAV2L.mjs +56 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-BK8BTUon.mjs +18 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react_mf_2_dom__loadShare__.mjs-B6pR25zU.mjs +28 -0
- package/dist/__mfe_internal__addon_tailscale_client_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-kyoamNQ7.mjs +18 -0
- package/dist/_stub.js +652 -0
- package/dist/_virtual_mf-localSharedImportMap___mfe_internal__addon_tailscale_client_page-PXP_-hRW.mjs +156 -0
- package/dist/addon-tailscale-client.css +3 -0
- package/dist/client-1J4MstR_.mjs +7592 -0
- package/dist/dist-C168hexw.mjs +17192 -0
- package/dist/dist-CPnIfsyh.mjs +2229 -0
- package/dist/dist-CmoRvaEc.mjs +2483 -0
- package/dist/dist-CwyDJZhZ.mjs +16329 -0
- package/dist/dist-DNrrMIdr.mjs +662 -0
- package/dist/dist-i1I4ldIE.mjs +1260 -0
- package/dist/getErrorShape-BPSzUA7W-C2H3tqHP.mjs +189 -0
- package/dist/hostInit-KpnzzkeJ.mjs +144 -0
- package/dist/index.js +9 -0
- package/dist/index.mjs +2 -0
- package/dist/jsx-runtime-BmcMHbj3.mjs +22 -0
- package/dist/modern-CWdms43F.mjs +2184 -0
- package/dist/react-BXkW-3WQ.mjs +293 -0
- package/dist/react-dom-BcGsvCWU.mjs +131 -0
- package/dist/remoteEntry.js +83 -0
- package/dist/rolldown-runtime-DC4cgjXG.mjs +20 -0
- package/dist/tailscale.addon.js +633 -0
- package/dist/tailscale.addon.js.map +1 -0
- package/dist/tailscale.addon.mjs +627 -0
- package/dist/tailscale.addon.mjs.map +1 -0
- package/dist/virtualExposes-wANYNTM2.mjs +27 -0
- package/package.json +94 -0
|
@@ -0,0 +1,2229 @@
|
|
|
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: te, ssrRemoteEntry: h } = e.metaData, { exposes: g } = e, ne = {
|
|
81
|
+
version: i || "",
|
|
82
|
+
buildVersion: ee,
|
|
83
|
+
globalName: te,
|
|
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: g?.map((e) => ({
|
|
97
|
+
moduleName: e.name,
|
|
98
|
+
modulePath: e.path,
|
|
99
|
+
assets: e.assets
|
|
100
|
+
}))
|
|
101
|
+
};
|
|
102
|
+
if ("publicPath" in e.metaData ? (a = {
|
|
103
|
+
...ne,
|
|
104
|
+
publicPath: o()
|
|
105
|
+
}, typeof e.metaData.ssrPublicPath == "string" && (a.ssrPublicPath = e.metaData.ssrPublicPath)) : a = {
|
|
106
|
+
...ne,
|
|
107
|
+
getPublicPath: o()
|
|
108
|
+
}, h) {
|
|
109
|
+
let e = p(h.path, h.name);
|
|
110
|
+
a.ssrRemoteEntry = e, a.ssrRemoteEntryType = h.type || "commonjs-module";
|
|
111
|
+
}
|
|
112
|
+
return a;
|
|
113
|
+
}
|
|
114
|
+
function te(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 h = "[ Module Federation ]", g = console, ne = [
|
|
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 re() {
|
|
131
|
+
try {
|
|
132
|
+
let e = (/* @__PURE__ */ Error()).stack;
|
|
133
|
+
if (!e) return;
|
|
134
|
+
let [, ...t] = e.split("\n"), n = t.filter((e) => !ne.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 ie = class {
|
|
141
|
+
constructor(e, t = g) {
|
|
142
|
+
this.prefix = e, this.delegate = t ?? g;
|
|
143
|
+
}
|
|
144
|
+
setPrefix(e) {
|
|
145
|
+
this.prefix = e;
|
|
146
|
+
}
|
|
147
|
+
setDelegate(e) {
|
|
148
|
+
this.delegate = e ?? g;
|
|
149
|
+
}
|
|
150
|
+
emit(e, t) {
|
|
151
|
+
let n = this.delegate, r = s() ? re() : 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 = g[e];
|
|
177
|
+
if (typeof t == "function") {
|
|
178
|
+
t.call(g, 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 ae(e) {
|
|
206
|
+
return new ie(e);
|
|
207
|
+
}
|
|
208
|
+
function oe(e) {
|
|
209
|
+
let t = new ie(e);
|
|
210
|
+
return Object.defineProperty(t, "__mf_infrastructure_logger__", {
|
|
211
|
+
value: !0,
|
|
212
|
+
enumerable: !1,
|
|
213
|
+
configurable: !1
|
|
214
|
+
}), t;
|
|
215
|
+
}
|
|
216
|
+
ae(h), oe(h);
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region ../../node_modules/@module-federation/sdk/dist/dom.js
|
|
219
|
+
async function se(e, t) {
|
|
220
|
+
try {
|
|
221
|
+
return await e();
|
|
222
|
+
} catch (e) {
|
|
223
|
+
!t && d(e);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function ce(e, t) {
|
|
228
|
+
let n = /^(https?:)?\/\//i;
|
|
229
|
+
return e.replace(n, "").replace(/\/$/, "") === t.replace(n, "").replace(/\/$/, "");
|
|
230
|
+
}
|
|
231
|
+
function le(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 && ce(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 && ce(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, se(() => {
|
|
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 ue(e) {
|
|
287
|
+
let t = null, n = !0, r = document.getElementsByTagName("link");
|
|
288
|
+
for (let i = 0; i < r.length; i++) {
|
|
289
|
+
let a = r[i], o = a.getAttribute("href"), s = a.getAttribute("rel");
|
|
290
|
+
if (o && ce(o, e.url) && s === e.attrs.rel) {
|
|
291
|
+
t = a, n = !1;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (!t) {
|
|
296
|
+
t = document.createElement("link"), t.setAttribute("href", e.url);
|
|
297
|
+
let n, r = e.attrs;
|
|
298
|
+
e.createLinkHook && (n = e.createLinkHook(e.url, r), n instanceof HTMLLinkElement && (t = n)), r && !n && Object.keys(r).forEach((e) => {
|
|
299
|
+
t && !t.getAttribute(e) && t.setAttribute(e, r[e]);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
let i = (n, r) => {
|
|
303
|
+
let i = () => {
|
|
304
|
+
r?.type === "error" ? e?.onErrorCallback && e?.onErrorCallback(r) : e?.cb && e?.cb();
|
|
305
|
+
};
|
|
306
|
+
if (t && (t.onerror = null, t.onload = null, se(() => {
|
|
307
|
+
let { needDeleteLink: n = !0 } = e;
|
|
308
|
+
n && t?.parentNode && t.parentNode.removeChild(t);
|
|
309
|
+
}), n)) {
|
|
310
|
+
let e = n(r);
|
|
311
|
+
return i(), e;
|
|
312
|
+
}
|
|
313
|
+
i();
|
|
314
|
+
};
|
|
315
|
+
return t.onerror = i.bind(null, t.onerror), t.onload = i.bind(null, t.onload), {
|
|
316
|
+
link: t,
|
|
317
|
+
needAttach: n
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
function de(e, t) {
|
|
321
|
+
let { attrs: n = {}, createScriptHook: r } = t;
|
|
322
|
+
return new Promise((t, i) => {
|
|
323
|
+
let { script: a, needAttach: o } = le({
|
|
324
|
+
url: e,
|
|
325
|
+
cb: t,
|
|
326
|
+
onErrorCallback: i,
|
|
327
|
+
attrs: {
|
|
328
|
+
fetchpriority: "high",
|
|
329
|
+
...n
|
|
330
|
+
},
|
|
331
|
+
createScriptHook: r,
|
|
332
|
+
needDeleteScript: !0
|
|
333
|
+
});
|
|
334
|
+
o && document.head.appendChild(a);
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region ../../node_modules/@module-federation/error-codes/dist/getShortErrorMsg.mjs
|
|
339
|
+
var fe = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, pe = (e, t, n, r) => {
|
|
340
|
+
let i = [`${[t[e]]} #${e}`];
|
|
341
|
+
return n && i.push(`args: ${JSON.stringify(n)}`), i.push(fe(e)), r && i.push(`Original Error Message:\n ${r}`), i.join("\n");
|
|
342
|
+
};
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region ../../node_modules/@module-federation/error-codes/dist/browser.mjs
|
|
345
|
+
function me(e, t, n, r, i, a) {
|
|
346
|
+
return r(pe(e, t, n, i));
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/logger.js
|
|
350
|
+
var _ = "[ Federation Runtime ]", he = ae(_);
|
|
351
|
+
function v(e, t, n, r, i) {
|
|
352
|
+
e || (n === void 0 ? y(t) : y(t, n, r, void 0, i));
|
|
353
|
+
}
|
|
354
|
+
function y(e, t, n, r, i) {
|
|
355
|
+
if (t !== void 0) return me(e, t, n ?? {}, (e) => {
|
|
356
|
+
throw Error(`${_}: ${e}`);
|
|
357
|
+
}, r, i);
|
|
358
|
+
let a = e;
|
|
359
|
+
throw a instanceof Error ? (a.message.startsWith(_) || (a.message = `${_}: ${a.message}`), a) : Error(`${_}: ${a}`);
|
|
360
|
+
}
|
|
361
|
+
function ge(e) {
|
|
362
|
+
e instanceof Error && (e.message.startsWith(_) || (e.message = `${_}: ${e.message}`)), he.warn(e);
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/tool.js
|
|
366
|
+
function _e(e, t) {
|
|
367
|
+
return e.findIndex((e) => e === t) === -1 && e.push(t), e;
|
|
368
|
+
}
|
|
369
|
+
function b(e) {
|
|
370
|
+
return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
|
|
371
|
+
}
|
|
372
|
+
function ve(e) {
|
|
373
|
+
return e.entry !== void 0;
|
|
374
|
+
}
|
|
375
|
+
function ye(e) {
|
|
376
|
+
return !e.entry.includes(".json");
|
|
377
|
+
}
|
|
378
|
+
function be(e) {
|
|
379
|
+
return e && typeof e == "object";
|
|
380
|
+
}
|
|
381
|
+
var xe = Object.prototype.toString;
|
|
382
|
+
function Se(e) {
|
|
383
|
+
return xe.call(e) === "[object Object]";
|
|
384
|
+
}
|
|
385
|
+
function Ce(e) {
|
|
386
|
+
return Array.isArray(e) ? e : [e];
|
|
387
|
+
}
|
|
388
|
+
function we(e) {
|
|
389
|
+
return "remoteEntry" in e ? {
|
|
390
|
+
url: e.remoteEntry,
|
|
391
|
+
type: e.remoteEntryType,
|
|
392
|
+
globalName: e.globalName
|
|
393
|
+
} : {
|
|
394
|
+
url: "",
|
|
395
|
+
type: "global",
|
|
396
|
+
globalName: ""
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
var Te = (e, t) => {
|
|
400
|
+
let n;
|
|
401
|
+
return n = e.endsWith("/") ? e.slice(0, -1) : e, t.startsWith(".") && (t = t.slice(1)), n += t, n;
|
|
402
|
+
}, x = typeof globalThis == "object" ? globalThis : window, S = (() => {
|
|
403
|
+
try {
|
|
404
|
+
return document.defaultView;
|
|
405
|
+
} catch {
|
|
406
|
+
return x;
|
|
407
|
+
}
|
|
408
|
+
})(), C = S;
|
|
409
|
+
function w(e, t, n) {
|
|
410
|
+
Object.defineProperty(e, t, {
|
|
411
|
+
value: n,
|
|
412
|
+
configurable: !1,
|
|
413
|
+
writable: !0
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
function T(e, t) {
|
|
417
|
+
return Object.hasOwnProperty.call(e, t);
|
|
418
|
+
}
|
|
419
|
+
T(x, "__GLOBAL_LOADING_REMOTE_ENTRY__") || w(x, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
420
|
+
var E = x.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
421
|
+
function Ee(e) {
|
|
422
|
+
T(e, "__VMOK__") && !T(e, "__FEDERATION__") && w(e, "__FEDERATION__", e.__VMOK__), T(e, "__FEDERATION__") || (w(e, "__FEDERATION__", {
|
|
423
|
+
__GLOBAL_PLUGIN__: [],
|
|
424
|
+
__INSTANCES__: [],
|
|
425
|
+
moduleInfo: {},
|
|
426
|
+
__SHARE__: {},
|
|
427
|
+
__MANIFEST_LOADING__: {},
|
|
428
|
+
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
429
|
+
}), w(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();
|
|
430
|
+
}
|
|
431
|
+
Ee(x), Ee(S);
|
|
432
|
+
function De(e) {
|
|
433
|
+
x.__FEDERATION__.__INSTANCES__.push(e);
|
|
434
|
+
}
|
|
435
|
+
function Oe() {
|
|
436
|
+
return x.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
|
|
437
|
+
}
|
|
438
|
+
function ke(e, t = s()) {
|
|
439
|
+
t && (x.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, x.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.4.0");
|
|
440
|
+
}
|
|
441
|
+
function D(e, t) {
|
|
442
|
+
if (typeof t == "string") {
|
|
443
|
+
if (e[t]) return {
|
|
444
|
+
value: e[t],
|
|
445
|
+
key: t
|
|
446
|
+
};
|
|
447
|
+
{
|
|
448
|
+
let n = Object.keys(e);
|
|
449
|
+
for (let r of n) {
|
|
450
|
+
let [n, i] = r.split(":"), a = `${n}:${t}`, o = e[a];
|
|
451
|
+
if (o) return {
|
|
452
|
+
value: o,
|
|
453
|
+
key: a
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
return {
|
|
457
|
+
value: void 0,
|
|
458
|
+
key: t
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
} else y(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
|
|
462
|
+
}
|
|
463
|
+
var Ae = () => S.__FEDERATION__.moduleInfo, je = (e, t) => {
|
|
464
|
+
let n = D(t, b(e)).value;
|
|
465
|
+
if (n && !n.version && "version" in e && e.version && (n.version = e.version), n) return n;
|
|
466
|
+
if ("version" in e && e.version) {
|
|
467
|
+
let { version: t, ...n } = e, r = b(n), i = D(S.__FEDERATION__.moduleInfo, r).value;
|
|
468
|
+
if (i?.version === t) return i;
|
|
469
|
+
}
|
|
470
|
+
}, O = (e) => je(e, S.__FEDERATION__.moduleInfo), Me = (e, t) => {
|
|
471
|
+
let n = b(e);
|
|
472
|
+
return S.__FEDERATION__.moduleInfo[n] = t, S.__FEDERATION__.moduleInfo;
|
|
473
|
+
}, Ne = (e) => (S.__FEDERATION__.moduleInfo = {
|
|
474
|
+
...S.__FEDERATION__.moduleInfo,
|
|
475
|
+
...e
|
|
476
|
+
}, () => {
|
|
477
|
+
let t = Object.keys(e);
|
|
478
|
+
for (let e of t) delete S.__FEDERATION__.moduleInfo[e];
|
|
479
|
+
}), Pe = (e, t) => {
|
|
480
|
+
let n = t || `__FEDERATION_${e}:custom__`;
|
|
481
|
+
return {
|
|
482
|
+
remoteEntryKey: n,
|
|
483
|
+
entryExports: x[n]
|
|
484
|
+
};
|
|
485
|
+
}, Fe = () => S.__FEDERATION__.__GLOBAL_PLUGIN__, Ie = (e) => x.__FEDERATION__.__PRELOADED_MAP__.get(e), Le = (e) => x.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Re = "[0-9A-Za-z-]+", ze = `(?:\\+(${Re}(?:\\.${Re})*))`, k = "0|[1-9]\\d*", A = "[0-9]+", Be = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ve = `(?:${A}|${Be})`, He = `(?:-?(${Ve}(?:\\.${Ve})*))`, Ue = `(?:${k}|${Be})`, We = `(?:-(${Ue}(?:\\.${Ue})*))`, Ge = `${k}|x|X|\\*`, j = `[v=\\s]*(${Ge})(?:\\.(${Ge})(?:\\.(${Ge})(?:${We})?${ze}?)?)?`, Ke = `^\\s*(${j})\\s+-\\s+(${j})\\s*$`, qe = `[v=\\s]*${`(${A})\\.(${A})\\.(${A})`}${He}?${ze}?`, Je = "((?:<|>)?=?)", Ye = `(\\s*)${Je}\\s*(${qe}|${j})`, Xe = "(?:~>?)", Ze = `(\\s*)${Xe}\\s+`, Qe = "(?:\\^)", $e = `(\\s*)${Qe}\\s+`, et = "(<|>)?=?\\s*\\*", tt = `^${Qe}${j}$`, nt = `v?${`(${k})\\.(${k})\\.(${k})`}${We}?${ze}?`, rt = `^${Xe}${j}$`, it = `^${Je}\\s*${j}$`, at = `^${Je}\\s*(${nt})$|^$`, ot = "^\\s*>=\\s*0.0.0\\s*$";
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/semver/utils.js
|
|
488
|
+
function M(e) {
|
|
489
|
+
return new RegExp(e);
|
|
490
|
+
}
|
|
491
|
+
function N(e) {
|
|
492
|
+
return !e || e.toLowerCase() === "x" || e === "*";
|
|
493
|
+
}
|
|
494
|
+
function st(...e) {
|
|
495
|
+
return (t) => e.reduce((e, t) => t(e), t);
|
|
496
|
+
}
|
|
497
|
+
function ct(e) {
|
|
498
|
+
return e.match(M(at));
|
|
499
|
+
}
|
|
500
|
+
function lt(e, t, n, r) {
|
|
501
|
+
let i = `${e}.${t}.${n}`;
|
|
502
|
+
return r ? `${i}-${r}` : i;
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
505
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/semver/parser.js
|
|
506
|
+
function ut(e) {
|
|
507
|
+
return e.replace(M(Ke), (e, t, n, r, i, a, o, s, c, l, u, d) => (t = N(n) ? "" : N(r) ? `>=${n}.0.0` : N(i) ? `>=${n}.${r}.0` : `>=${t}`, s = N(c) ? "" : N(l) ? `<${Number(c) + 1}.0.0-0` : N(u) ? `<${c}.${Number(l) + 1}.0-0` : d ? `<=${c}.${l}.${u}-${d}` : `<=${s}`, `${t} ${s}`.trim()));
|
|
508
|
+
}
|
|
509
|
+
function dt(e) {
|
|
510
|
+
return e.replace(M(Ye), "$1$2$3");
|
|
511
|
+
}
|
|
512
|
+
function ft(e) {
|
|
513
|
+
return e.replace(M(Ze), "$1~");
|
|
514
|
+
}
|
|
515
|
+
function pt(e) {
|
|
516
|
+
return e.replace(M($e), "$1^");
|
|
517
|
+
}
|
|
518
|
+
function mt(e) {
|
|
519
|
+
return e.trim().split(/\s+/).map((e) => e.replace(M(tt), (e, t, n, r, i) => N(t) ? "" : N(n) ? `>=${t}.0.0 <${Number(t) + 1}.0.0-0` : N(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(" ");
|
|
520
|
+
}
|
|
521
|
+
function ht(e) {
|
|
522
|
+
return e.trim().split(/\s+/).map((e) => e.replace(M(rt), (e, t, n, r, i) => N(t) ? "" : N(n) ? `>=${t}.0.0 <${Number(t) + 1}.0.0-0` : N(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(" ");
|
|
523
|
+
}
|
|
524
|
+
function gt(e) {
|
|
525
|
+
return e.split(/\s+/).map((e) => e.trim().replace(M(it), (e, t, n, r, i, a) => {
|
|
526
|
+
let o = N(n), s = o || N(r), c = s || N(i);
|
|
527
|
+
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;
|
|
528
|
+
})).join(" ");
|
|
529
|
+
}
|
|
530
|
+
function _t(e) {
|
|
531
|
+
return e.trim().replace(M(et), "");
|
|
532
|
+
}
|
|
533
|
+
function vt(e) {
|
|
534
|
+
return e.trim().replace(M(ot), "");
|
|
535
|
+
}
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/semver/compare.js
|
|
538
|
+
function P(e, t) {
|
|
539
|
+
return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
|
|
540
|
+
}
|
|
541
|
+
function yt(e, t) {
|
|
542
|
+
let { preRelease: n } = e, { preRelease: r } = t;
|
|
543
|
+
if (n === void 0 && r) return 1;
|
|
544
|
+
if (n && r === void 0) return -1;
|
|
545
|
+
if (n === void 0 && r === void 0) return 0;
|
|
546
|
+
for (let e = 0, t = n.length; e <= t; e++) {
|
|
547
|
+
let t = n[e], i = r[e];
|
|
548
|
+
if (t !== i) return t === void 0 && i === void 0 ? 0 : t ? i ? P(t, i) : -1 : 1;
|
|
549
|
+
}
|
|
550
|
+
return 0;
|
|
551
|
+
}
|
|
552
|
+
function F(e, t) {
|
|
553
|
+
return P(e.major, t.major) || P(e.minor, t.minor) || P(e.patch, t.patch) || yt(e, t);
|
|
554
|
+
}
|
|
555
|
+
function bt(e, t) {
|
|
556
|
+
return e.version === t.version;
|
|
557
|
+
}
|
|
558
|
+
function xt(e, t) {
|
|
559
|
+
switch (e.operator) {
|
|
560
|
+
case "":
|
|
561
|
+
case "=": return bt(e, t);
|
|
562
|
+
case ">": return F(e, t) < 0;
|
|
563
|
+
case ">=": return bt(e, t) || F(e, t) < 0;
|
|
564
|
+
case "<": return F(e, t) > 0;
|
|
565
|
+
case "<=": return bt(e, t) || F(e, t) > 0;
|
|
566
|
+
case void 0: return !0;
|
|
567
|
+
default: return !1;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/semver/index.js
|
|
572
|
+
function St(e) {
|
|
573
|
+
return st(mt, ht, gt, _t)(e);
|
|
574
|
+
}
|
|
575
|
+
function Ct(e) {
|
|
576
|
+
return st(ut, dt, ft, pt)(e.trim()).split(/\s+/).join(" ");
|
|
577
|
+
}
|
|
578
|
+
function I(e, t) {
|
|
579
|
+
if (!e) return !1;
|
|
580
|
+
let n = ct(e);
|
|
581
|
+
if (!n) return !1;
|
|
582
|
+
let [, r, , i, a, o, s] = n, c = {
|
|
583
|
+
operator: r,
|
|
584
|
+
version: lt(i, a, o, s),
|
|
585
|
+
major: i,
|
|
586
|
+
minor: a,
|
|
587
|
+
patch: o,
|
|
588
|
+
preRelease: s?.split(".")
|
|
589
|
+
}, l = t.split("||");
|
|
590
|
+
for (let e of l) {
|
|
591
|
+
let t = e.trim();
|
|
592
|
+
if (!t || t === "*" || t === "x") return !0;
|
|
593
|
+
try {
|
|
594
|
+
let e = Ct(t);
|
|
595
|
+
if (!e.trim()) return !0;
|
|
596
|
+
let n = e.split(" ").map((e) => St(e)).join(" ");
|
|
597
|
+
if (!n.trim()) return !0;
|
|
598
|
+
let r = n.split(/\s+/).map((e) => vt(e)).filter(Boolean);
|
|
599
|
+
if (r.length === 0) continue;
|
|
600
|
+
let i = !0;
|
|
601
|
+
for (let e of r) {
|
|
602
|
+
let t = ct(e);
|
|
603
|
+
if (!t) {
|
|
604
|
+
i = !1;
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
let [, n, , r, a, o, s] = t;
|
|
608
|
+
if (!xt({
|
|
609
|
+
operator: n,
|
|
610
|
+
version: lt(r, a, o, s),
|
|
611
|
+
major: r,
|
|
612
|
+
minor: a,
|
|
613
|
+
patch: o,
|
|
614
|
+
preRelease: s?.split(".")
|
|
615
|
+
}, c)) {
|
|
616
|
+
i = !1;
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if (i) return !0;
|
|
621
|
+
} catch (e) {
|
|
622
|
+
console.error(`[semver] Error processing range part "${t}":`, e);
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
return !1;
|
|
627
|
+
}
|
|
628
|
+
//#endregion
|
|
629
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/constant.js
|
|
630
|
+
var L = "default", wt = "global";
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/share.js
|
|
633
|
+
function Tt(e, t, n, i) {
|
|
634
|
+
let a;
|
|
635
|
+
return a = "get" in e ? e.get : "lib" in e ? () => Promise.resolve(e.lib) : () => Promise.resolve(() => {
|
|
636
|
+
y(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
|
|
637
|
+
}), e.shareConfig?.eager && e.treeShaking?.mode && y(`Invalid shared config for "${n}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
|
|
638
|
+
deps: [],
|
|
639
|
+
useIn: [],
|
|
640
|
+
from: t,
|
|
641
|
+
loading: null,
|
|
642
|
+
...e,
|
|
643
|
+
shareConfig: {
|
|
644
|
+
requiredVersion: `^${e.version}`,
|
|
645
|
+
singleton: !1,
|
|
646
|
+
eager: !1,
|
|
647
|
+
strictVersion: !1,
|
|
648
|
+
...e.shareConfig
|
|
649
|
+
},
|
|
650
|
+
get: a,
|
|
651
|
+
loaded: e?.loaded || "lib" in e ? !0 : void 0,
|
|
652
|
+
version: e.version ?? "0",
|
|
653
|
+
scope: Array.isArray(e.scope) ? e.scope : [e.scope ?? "default"],
|
|
654
|
+
strategy: (e.strategy ?? i) || "version-first",
|
|
655
|
+
treeShaking: e.treeShaking ? {
|
|
656
|
+
...e.treeShaking,
|
|
657
|
+
mode: e.treeShaking.mode ?? "server-calc",
|
|
658
|
+
status: e.treeShaking.status ?? r.UNKNOWN,
|
|
659
|
+
useIn: []
|
|
660
|
+
} : void 0
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
function Et(e, t) {
|
|
664
|
+
let n = t.shared || {}, r = t.name, i = Object.keys(n).reduce((e, i) => {
|
|
665
|
+
let a = Ce(n[i]);
|
|
666
|
+
return e[i] = e[i] || [], a.forEach((n) => {
|
|
667
|
+
e[i].push(Tt(n, r, i, t.shareStrategy));
|
|
668
|
+
}), e;
|
|
669
|
+
}, {}), a = { ...e.shared };
|
|
670
|
+
return Object.keys(i).forEach((e) => {
|
|
671
|
+
a[e] ? i[e].forEach((t) => {
|
|
672
|
+
a[e].find((e) => e.version === t.version) || a[e].push(t);
|
|
673
|
+
}) : a[e] = i[e];
|
|
674
|
+
}), {
|
|
675
|
+
allShareInfos: a,
|
|
676
|
+
newShareInfos: i
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
function R(e, t) {
|
|
680
|
+
if (!e) return !1;
|
|
681
|
+
let { status: n, mode: i } = e;
|
|
682
|
+
return n === r.NO_USE ? !1 : n === r.CALCULATED ? !0 : i === "runtime-infer" ? t ? Ot(e, t) : !0 : !1;
|
|
683
|
+
}
|
|
684
|
+
function z(e, t) {
|
|
685
|
+
let n = (e) => {
|
|
686
|
+
if (!Number.isNaN(Number(e))) {
|
|
687
|
+
let t = e.split("."), n = e;
|
|
688
|
+
for (let e = 0; e < 3 - t.length; e++) n += ".0";
|
|
689
|
+
return n;
|
|
690
|
+
}
|
|
691
|
+
return e;
|
|
692
|
+
};
|
|
693
|
+
return !!I(n(e), `<=${n(t)}`);
|
|
694
|
+
}
|
|
695
|
+
var B = (e, t) => {
|
|
696
|
+
let n = t || function(e, t) {
|
|
697
|
+
return z(e, t);
|
|
698
|
+
};
|
|
699
|
+
return Object.keys(e).reduce((e, t) => !e || n(e, t) || e === "0" ? t : e, 0);
|
|
700
|
+
}, V = (e) => !!e.loaded || typeof e.lib == "function", Dt = (e) => !!e.loading, Ot = (e, t) => {
|
|
701
|
+
if (!e || !t) return !1;
|
|
702
|
+
let { usedExports: n } = e;
|
|
703
|
+
return n ? !!t.every((e) => n.includes(e)) : !1;
|
|
704
|
+
};
|
|
705
|
+
function kt(e, t, n, r) {
|
|
706
|
+
let i = e[t][n], a = "", o = R(r), s = function(e, t) {
|
|
707
|
+
return o ? i[e].treeShaking ? i[t].treeShaking ? !V(i[e].treeShaking) && z(e, t) : !1 : !0 : !V(i[e]) && z(e, t);
|
|
708
|
+
};
|
|
709
|
+
if (o) {
|
|
710
|
+
if (a = B(e[t][n], s), a) return {
|
|
711
|
+
version: a,
|
|
712
|
+
useTreesShaking: o
|
|
713
|
+
};
|
|
714
|
+
o = !1;
|
|
715
|
+
}
|
|
716
|
+
return {
|
|
717
|
+
version: B(e[t][n], s),
|
|
718
|
+
useTreesShaking: o
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
var H = (e) => V(e) || Dt(e);
|
|
722
|
+
function At(e, t, n, r) {
|
|
723
|
+
let i = e[t][n], a = "", o = R(r), s = function(e, t) {
|
|
724
|
+
if (o) {
|
|
725
|
+
if (!i[e].treeShaking) return !0;
|
|
726
|
+
if (!i[t].treeShaking) return !1;
|
|
727
|
+
if (H(i[t].treeShaking)) return H(i[e].treeShaking) ? !!z(e, t) : !0;
|
|
728
|
+
if (H(i[e].treeShaking)) return !1;
|
|
729
|
+
}
|
|
730
|
+
return H(i[t]) ? H(i[e]) ? !!z(e, t) : !0 : H(i[e]) ? !1 : z(e, t);
|
|
731
|
+
};
|
|
732
|
+
if (o) {
|
|
733
|
+
if (a = B(e[t][n], s), a) return {
|
|
734
|
+
version: a,
|
|
735
|
+
useTreesShaking: o
|
|
736
|
+
};
|
|
737
|
+
o = !1;
|
|
738
|
+
}
|
|
739
|
+
return {
|
|
740
|
+
version: B(e[t][n], s),
|
|
741
|
+
useTreesShaking: o
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
function jt(e) {
|
|
745
|
+
return e === "loaded-first" ? At : kt;
|
|
746
|
+
}
|
|
747
|
+
function U(e, t, n, r) {
|
|
748
|
+
if (!e) return;
|
|
749
|
+
let { shareConfig: i, scope: a = L, strategy: o, treeShaking: s } = n, c = Array.isArray(a) ? a : [a];
|
|
750
|
+
for (let a of c) if (i && e[a] && e[a][t]) {
|
|
751
|
+
let { requiredVersion: c } = i, { version: l, useTreesShaking: u } = jt(o)(e, a, t, s), d = {
|
|
752
|
+
shareScopeMap: e,
|
|
753
|
+
scope: a,
|
|
754
|
+
pkgName: t,
|
|
755
|
+
version: l,
|
|
756
|
+
GlobalFederation: C.__FEDERATION__,
|
|
757
|
+
shareInfo: n,
|
|
758
|
+
resolver: () => {
|
|
759
|
+
let r = e[a][t][l];
|
|
760
|
+
if (i.singleton) {
|
|
761
|
+
if (typeof c == "string" && !I(l, c)) {
|
|
762
|
+
let e = `Version ${l} from ${l && r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${c})`;
|
|
763
|
+
i.strictVersion ? y(e) : ge(e);
|
|
764
|
+
}
|
|
765
|
+
return {
|
|
766
|
+
shared: r,
|
|
767
|
+
useTreesShaking: u
|
|
768
|
+
};
|
|
769
|
+
} else {
|
|
770
|
+
if (c === !1 || c === "*" || I(l, c)) return {
|
|
771
|
+
shared: r,
|
|
772
|
+
useTreesShaking: u
|
|
773
|
+
};
|
|
774
|
+
let n = R(s);
|
|
775
|
+
if (n) {
|
|
776
|
+
for (let [r, i] of Object.entries(e[a][t])) if (R(i.treeShaking, s?.usedExports) && I(r, c)) return {
|
|
777
|
+
shared: i,
|
|
778
|
+
useTreesShaking: n
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
for (let [n, r] of Object.entries(e[a][t])) if (I(n, c)) return {
|
|
782
|
+
shared: r,
|
|
783
|
+
useTreesShaking: !1
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
return (r.emit(d) || d).resolver();
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
function Mt() {
|
|
792
|
+
return C.__FEDERATION__.__SHARE__;
|
|
793
|
+
}
|
|
794
|
+
function Nt(e) {
|
|
795
|
+
let { pkgName: t, extraOptions: n, shareInfos: r } = e, i = n?.resolver ?? ((e) => {
|
|
796
|
+
if (!e) return;
|
|
797
|
+
let t = {};
|
|
798
|
+
return e.forEach((e) => {
|
|
799
|
+
t[e.version] = e;
|
|
800
|
+
}), t[B(t, function(e, n) {
|
|
801
|
+
return !V(t[e]) && z(e, n);
|
|
802
|
+
})];
|
|
803
|
+
}), a = (e) => typeof e == "object" && !!e && !Array.isArray(e), o = (...e) => {
|
|
804
|
+
let t = {};
|
|
805
|
+
for (let n of e) if (n) for (let [e, r] of Object.entries(n)) {
|
|
806
|
+
let n = t[e];
|
|
807
|
+
a(n) && a(r) ? t[e] = o(n, r) : r !== void 0 && (t[e] = r);
|
|
808
|
+
}
|
|
809
|
+
return t;
|
|
810
|
+
};
|
|
811
|
+
return o(i(r[t]), n?.customShareInfo);
|
|
812
|
+
}
|
|
813
|
+
var W = (e, t) => {
|
|
814
|
+
e.useIn ||= [], _e(e.useIn, t);
|
|
815
|
+
};
|
|
816
|
+
function G(e, t) {
|
|
817
|
+
return t && e.treeShaking ? e.treeShaking : e;
|
|
818
|
+
}
|
|
819
|
+
//#endregion
|
|
820
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/manifest.js
|
|
821
|
+
function Pt(e, t) {
|
|
822
|
+
for (let n of e) {
|
|
823
|
+
let e = t.startsWith(n.name), r = t.replace(n.name, "");
|
|
824
|
+
if (e) {
|
|
825
|
+
if (r.startsWith("/")) {
|
|
826
|
+
let e = n.name;
|
|
827
|
+
return r = `.${r}`, {
|
|
828
|
+
pkgNameOrAlias: e,
|
|
829
|
+
expose: r,
|
|
830
|
+
remote: n
|
|
831
|
+
};
|
|
832
|
+
} else if (r === "") return {
|
|
833
|
+
pkgNameOrAlias: n.name,
|
|
834
|
+
expose: ".",
|
|
835
|
+
remote: n
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
let i = n.alias && t.startsWith(n.alias), a = n.alias && t.replace(n.alias, "");
|
|
839
|
+
if (n.alias && i) {
|
|
840
|
+
if (a && a.startsWith("/")) {
|
|
841
|
+
let e = n.alias;
|
|
842
|
+
return a = `.${a}`, {
|
|
843
|
+
pkgNameOrAlias: e,
|
|
844
|
+
expose: a,
|
|
845
|
+
remote: n
|
|
846
|
+
};
|
|
847
|
+
} else if (a === "") return {
|
|
848
|
+
pkgNameOrAlias: n.alias,
|
|
849
|
+
expose: ".",
|
|
850
|
+
remote: n
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
function Ft(e, t) {
|
|
856
|
+
for (let n of e) if (t === n.name || n.alias && t === n.alias) return n;
|
|
857
|
+
}
|
|
858
|
+
//#endregion
|
|
859
|
+
//#region ../../node_modules/@module-federation/error-codes/dist/error-codes.mjs
|
|
860
|
+
var It = "RUNTIME-001", Lt = "RUNTIME-002", Rt = "RUNTIME-003", zt = "RUNTIME-004", Bt = "RUNTIME-005", Vt = "RUNTIME-006", Ht = "RUNTIME-007", Ut = "RUNTIME-008", Wt = "RUNTIME-009", Gt = "RUNTIME-010", Kt = "RUNTIME-011", qt = "RUNTIME-012", Jt = "TYPE-001", Yt = "BUILD-001", Xt = "BUILD-002", K = {
|
|
861
|
+
[It]: "Failed to get remoteEntry exports.",
|
|
862
|
+
[Lt]: "The remote entry interface does not contain \"init\"",
|
|
863
|
+
[Rt]: "Failed to get manifest.",
|
|
864
|
+
[zt]: "Failed to locate remote.",
|
|
865
|
+
[Bt]: "Invalid loadShareSync function call from bundler runtime",
|
|
866
|
+
[Vt]: "Invalid loadShareSync function call from runtime",
|
|
867
|
+
[Ht]: "Failed to get remote snapshot.",
|
|
868
|
+
[Ut]: "Failed to load script resources.",
|
|
869
|
+
[Wt]: "Please call createInstance first.",
|
|
870
|
+
[Gt]: "The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use \"createInstance\" api.",
|
|
871
|
+
[Kt]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
872
|
+
[qt]: "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."
|
|
873
|
+
}, Zt = { [Jt]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error." }, Qt = {
|
|
874
|
+
[Yt]: "Failed to find expose module.",
|
|
875
|
+
[Xt]: "PublicPath is required in prod mode."
|
|
876
|
+
};
|
|
877
|
+
({
|
|
878
|
+
...K,
|
|
879
|
+
...Zt,
|
|
880
|
+
...Qt
|
|
881
|
+
});
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/load.js
|
|
884
|
+
var $t = ".then(callbacks[0]).catch(callbacks[1])";
|
|
885
|
+
async function en({ entry: e, remoteEntryExports: t }) {
|
|
886
|
+
return new Promise((n, r) => {
|
|
887
|
+
try {
|
|
888
|
+
t ? n(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? Function("callbacks", `import("${e}")${$t}`)([n, r]) : import(
|
|
889
|
+
/* webpackIgnore: true */
|
|
890
|
+
/* @vite-ignore */
|
|
891
|
+
e
|
|
892
|
+
).then(n).catch(r);
|
|
893
|
+
} catch (t) {
|
|
894
|
+
y(`Failed to load ESM entry from "${e}". ${t instanceof Error ? t.message : String(t)}`);
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
async function tn({ entry: e, remoteEntryExports: t }) {
|
|
899
|
+
return new Promise((n, r) => {
|
|
900
|
+
try {
|
|
901
|
+
t ? n(t) : typeof __system_context__ > "u" ? System.import(e).then(n).catch(r) : Function("callbacks", `System.import("${e}")${$t}`)([n, r]);
|
|
902
|
+
} catch (t) {
|
|
903
|
+
y(`Failed to load SystemJS entry from "${e}". ${t instanceof Error ? t.message : String(t)}`);
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
function nn(e, t, n) {
|
|
908
|
+
let { remoteEntryKey: r, entryExports: i } = Pe(e, t);
|
|
909
|
+
return i || y(It, K, {
|
|
910
|
+
remoteName: e,
|
|
911
|
+
remoteEntryUrl: n,
|
|
912
|
+
remoteEntryKey: r
|
|
913
|
+
}), i;
|
|
914
|
+
}
|
|
915
|
+
async function rn({ name: e, globalName: t, entry: n, remoteInfo: r, loaderHook: i, getEntryUrl: a }) {
|
|
916
|
+
let { entryExports: o } = Pe(e, t);
|
|
917
|
+
if (o) return o;
|
|
918
|
+
let s = a ? a(n) : n;
|
|
919
|
+
return de(s, {
|
|
920
|
+
attrs: {},
|
|
921
|
+
createScriptHook: (e, t) => {
|
|
922
|
+
let n = i.lifecycle.createScript.emit({
|
|
923
|
+
url: e,
|
|
924
|
+
attrs: t,
|
|
925
|
+
remoteInfo: r
|
|
926
|
+
});
|
|
927
|
+
if (n && (n instanceof HTMLScriptElement || "script" in n || "timeout" in n)) return n;
|
|
928
|
+
}
|
|
929
|
+
}).then(() => nn(e, t, n), (t) => {
|
|
930
|
+
let n = t instanceof Error ? t.message : String(t);
|
|
931
|
+
y(Ut, K, {
|
|
932
|
+
remoteName: e,
|
|
933
|
+
resourceUrl: s
|
|
934
|
+
}, n);
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
async function an({ remoteInfo: e, remoteEntryExports: t, loaderHook: n, getEntryUrl: r }) {
|
|
938
|
+
let { entry: i, entryGlobalName: a, name: o, type: s } = e;
|
|
939
|
+
switch (s) {
|
|
940
|
+
case "esm":
|
|
941
|
+
case "module": return en({
|
|
942
|
+
entry: i,
|
|
943
|
+
remoteEntryExports: t
|
|
944
|
+
});
|
|
945
|
+
case "system": return tn({
|
|
946
|
+
entry: i,
|
|
947
|
+
remoteEntryExports: t
|
|
948
|
+
});
|
|
949
|
+
default: return rn({
|
|
950
|
+
entry: i,
|
|
951
|
+
globalName: a,
|
|
952
|
+
name: o,
|
|
953
|
+
remoteInfo: e,
|
|
954
|
+
loaderHook: n,
|
|
955
|
+
getEntryUrl: r
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
function on(e) {
|
|
960
|
+
let { entry: t, name: n } = e;
|
|
961
|
+
return l(n, t);
|
|
962
|
+
}
|
|
963
|
+
async function sn(e) {
|
|
964
|
+
let { origin: t, remoteEntryExports: n, remoteInfo: r, getEntryUrl: i, _inErrorHandling: a = !1 } = e, o = on(r);
|
|
965
|
+
if (n) return n;
|
|
966
|
+
if (!E[o]) {
|
|
967
|
+
let e = t.remoteHandler.hooks.lifecycle.loadEntry, s = t.loaderHook;
|
|
968
|
+
E[o] = e.emit({
|
|
969
|
+
loaderHook: s,
|
|
970
|
+
remoteInfo: r,
|
|
971
|
+
remoteEntryExports: n
|
|
972
|
+
}).then((e) => e || an({
|
|
973
|
+
remoteInfo: r,
|
|
974
|
+
remoteEntryExports: n,
|
|
975
|
+
loaderHook: s,
|
|
976
|
+
getEntryUrl: i
|
|
977
|
+
})).catch(async (e) => {
|
|
978
|
+
let i = on(r), o = e instanceof Error && e.message.includes("ScriptExecutionError");
|
|
979
|
+
if (e instanceof Error && e.message.includes("RUNTIME-008") && !o && !a) {
|
|
980
|
+
let e = await t.loaderHook.lifecycle.loadEntryError.emit({
|
|
981
|
+
getRemoteEntry: (e) => sn({
|
|
982
|
+
...e,
|
|
983
|
+
_inErrorHandling: !0
|
|
984
|
+
}),
|
|
985
|
+
origin: t,
|
|
986
|
+
remoteInfo: r,
|
|
987
|
+
remoteEntryExports: n,
|
|
988
|
+
globalLoading: E,
|
|
989
|
+
uniqueKey: i
|
|
990
|
+
});
|
|
991
|
+
if (e) return e;
|
|
992
|
+
}
|
|
993
|
+
throw e;
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
return E[o];
|
|
997
|
+
}
|
|
998
|
+
function q(e) {
|
|
999
|
+
return {
|
|
1000
|
+
...e,
|
|
1001
|
+
entry: "entry" in e ? e.entry : "",
|
|
1002
|
+
type: e.type || "global",
|
|
1003
|
+
entryGlobalName: e.entryGlobalName || e.name,
|
|
1004
|
+
shareScope: e.shareScope || "default"
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/env.js
|
|
1009
|
+
function cn() {
|
|
1010
|
+
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1011
|
+
}
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/plugin.js
|
|
1014
|
+
function ln(e, t) {
|
|
1015
|
+
let n = Fe(), r = [
|
|
1016
|
+
t.hooks,
|
|
1017
|
+
t.remoteHandler.hooks,
|
|
1018
|
+
t.sharedHandler.hooks,
|
|
1019
|
+
t.snapshotHandler.hooks,
|
|
1020
|
+
t.loaderHook,
|
|
1021
|
+
t.bridgeHook
|
|
1022
|
+
];
|
|
1023
|
+
return n.length > 0 && n.forEach((t) => {
|
|
1024
|
+
e?.find((e) => e.name !== t.name) && e.push(t);
|
|
1025
|
+
}), e && e.length > 0 && e.forEach((e) => {
|
|
1026
|
+
r.forEach((n) => {
|
|
1027
|
+
n.applyPlugin(e, t);
|
|
1028
|
+
});
|
|
1029
|
+
}), e;
|
|
1030
|
+
}
|
|
1031
|
+
//#endregion
|
|
1032
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/context.js
|
|
1033
|
+
function un(e) {
|
|
1034
|
+
return {
|
|
1035
|
+
name: e.name,
|
|
1036
|
+
alias: e.alias,
|
|
1037
|
+
entry: "entry" in e ? e.entry : void 0,
|
|
1038
|
+
version: "version" in e ? e.version : void 0,
|
|
1039
|
+
type: e.type,
|
|
1040
|
+
entryGlobalName: e.entryGlobalName,
|
|
1041
|
+
shareScope: e.shareScope
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
function J(e) {
|
|
1045
|
+
let t = {};
|
|
1046
|
+
for (let [n, r] of Object.entries(e.shared)) {
|
|
1047
|
+
let e = r[0];
|
|
1048
|
+
e && (t[n] = {
|
|
1049
|
+
version: e.version,
|
|
1050
|
+
singleton: e.shareConfig?.singleton,
|
|
1051
|
+
requiredVersion: e.shareConfig?.requiredVersion === !1 ? !1 : e.shareConfig?.requiredVersion,
|
|
1052
|
+
eager: e.eager,
|
|
1053
|
+
strictVersion: e.shareConfig?.strictVersion
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
return {
|
|
1057
|
+
project: {
|
|
1058
|
+
name: e.name,
|
|
1059
|
+
mfRole: e.remotes?.length > 0 ? "host" : "unknown"
|
|
1060
|
+
},
|
|
1061
|
+
mfConfig: {
|
|
1062
|
+
name: e.name,
|
|
1063
|
+
remotes: e.remotes?.map(un) ?? [],
|
|
1064
|
+
shared: t
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
//#endregion
|
|
1069
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/preload.js
|
|
1070
|
+
function dn(e) {
|
|
1071
|
+
return {
|
|
1072
|
+
resourceCategory: "sync",
|
|
1073
|
+
share: !0,
|
|
1074
|
+
depsRemote: !0,
|
|
1075
|
+
...e
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
function fn(e, t) {
|
|
1079
|
+
return t.map((t) => {
|
|
1080
|
+
let n = Ft(e, t.nameOrAlias);
|
|
1081
|
+
return v(n, `Unable to preload ${t.nameOrAlias} as it is not included in ${!n && f({
|
|
1082
|
+
remoteInfo: n,
|
|
1083
|
+
remotes: e
|
|
1084
|
+
})}`), {
|
|
1085
|
+
remote: n,
|
|
1086
|
+
preloadConfig: dn(t)
|
|
1087
|
+
};
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
function pn(e) {
|
|
1091
|
+
return e ? e.map((e) => e === "." ? e : e.startsWith("./") ? e.replace("./", "") : e) : [];
|
|
1092
|
+
}
|
|
1093
|
+
function mn(e, t, n, r = !0) {
|
|
1094
|
+
let { cssAssets: i, jsAssetsWithoutEntry: a, entryAssets: o } = n;
|
|
1095
|
+
if (t.options.inBrowser) {
|
|
1096
|
+
if (o.forEach((n) => {
|
|
1097
|
+
let { moduleInfo: r } = n, i = t.moduleCache.get(e.name);
|
|
1098
|
+
sn(i ? {
|
|
1099
|
+
origin: t,
|
|
1100
|
+
remoteInfo: r,
|
|
1101
|
+
remoteEntryExports: i.remoteEntryExports
|
|
1102
|
+
} : {
|
|
1103
|
+
origin: t,
|
|
1104
|
+
remoteInfo: r,
|
|
1105
|
+
remoteEntryExports: void 0
|
|
1106
|
+
});
|
|
1107
|
+
}), r) {
|
|
1108
|
+
let n = {
|
|
1109
|
+
rel: "preload",
|
|
1110
|
+
as: "style"
|
|
1111
|
+
};
|
|
1112
|
+
i.forEach((r) => {
|
|
1113
|
+
let { link: i, needAttach: a } = ue({
|
|
1114
|
+
url: r,
|
|
1115
|
+
cb: () => {},
|
|
1116
|
+
attrs: n,
|
|
1117
|
+
createLinkHook: (n, r) => {
|
|
1118
|
+
let i = t.loaderHook.lifecycle.createLink.emit({
|
|
1119
|
+
url: n,
|
|
1120
|
+
attrs: r,
|
|
1121
|
+
remoteInfo: e
|
|
1122
|
+
});
|
|
1123
|
+
if (i instanceof HTMLLinkElement) return i;
|
|
1124
|
+
}
|
|
1125
|
+
});
|
|
1126
|
+
a && document.head.appendChild(i);
|
|
1127
|
+
});
|
|
1128
|
+
} else {
|
|
1129
|
+
let n = {
|
|
1130
|
+
rel: "stylesheet",
|
|
1131
|
+
type: "text/css"
|
|
1132
|
+
};
|
|
1133
|
+
i.forEach((r) => {
|
|
1134
|
+
let { link: i, needAttach: a } = ue({
|
|
1135
|
+
url: r,
|
|
1136
|
+
cb: () => {},
|
|
1137
|
+
attrs: n,
|
|
1138
|
+
createLinkHook: (n, r) => {
|
|
1139
|
+
let i = t.loaderHook.lifecycle.createLink.emit({
|
|
1140
|
+
url: n,
|
|
1141
|
+
attrs: r,
|
|
1142
|
+
remoteInfo: e
|
|
1143
|
+
});
|
|
1144
|
+
if (i instanceof HTMLLinkElement) return i;
|
|
1145
|
+
},
|
|
1146
|
+
needDeleteLink: !1
|
|
1147
|
+
});
|
|
1148
|
+
a && document.head.appendChild(i);
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
if (r) {
|
|
1152
|
+
let n = {
|
|
1153
|
+
rel: "preload",
|
|
1154
|
+
as: "script"
|
|
1155
|
+
};
|
|
1156
|
+
a.forEach((r) => {
|
|
1157
|
+
let { link: i, needAttach: a } = ue({
|
|
1158
|
+
url: r,
|
|
1159
|
+
cb: () => {},
|
|
1160
|
+
attrs: n,
|
|
1161
|
+
createLinkHook: (n, r) => {
|
|
1162
|
+
let i = t.loaderHook.lifecycle.createLink.emit({
|
|
1163
|
+
url: n,
|
|
1164
|
+
attrs: r,
|
|
1165
|
+
remoteInfo: e
|
|
1166
|
+
});
|
|
1167
|
+
if (i instanceof HTMLLinkElement) return i;
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
a && document.head.appendChild(i);
|
|
1171
|
+
});
|
|
1172
|
+
} else {
|
|
1173
|
+
let n = {
|
|
1174
|
+
fetchpriority: "high",
|
|
1175
|
+
type: e?.type === "module" ? "module" : "text/javascript"
|
|
1176
|
+
};
|
|
1177
|
+
a.forEach((r) => {
|
|
1178
|
+
let { script: i, needAttach: a } = le({
|
|
1179
|
+
url: r,
|
|
1180
|
+
cb: () => {},
|
|
1181
|
+
attrs: n,
|
|
1182
|
+
createScriptHook: (n, r) => {
|
|
1183
|
+
let i = t.loaderHook.lifecycle.createScript.emit({
|
|
1184
|
+
url: n,
|
|
1185
|
+
attrs: r,
|
|
1186
|
+
remoteInfo: e
|
|
1187
|
+
});
|
|
1188
|
+
if (i instanceof HTMLScriptElement) return i;
|
|
1189
|
+
},
|
|
1190
|
+
needDeleteScript: !0
|
|
1191
|
+
});
|
|
1192
|
+
a && document.head.appendChild(i);
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
//#endregion
|
|
1198
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/module/index.js
|
|
1199
|
+
function hn(e, t, n) {
|
|
1200
|
+
let r = t, i = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
|
|
1201
|
+
i.length || i.push("default"), i.forEach((e) => {
|
|
1202
|
+
r[e] || (r[e] = {});
|
|
1203
|
+
});
|
|
1204
|
+
let a = {
|
|
1205
|
+
version: e.version || "",
|
|
1206
|
+
shareScopeKeys: Array.isArray(e.shareScope) ? i : e.shareScope || "default"
|
|
1207
|
+
};
|
|
1208
|
+
return Object.defineProperty(a, "shareScopeMap", {
|
|
1209
|
+
value: r,
|
|
1210
|
+
enumerable: !1
|
|
1211
|
+
}), {
|
|
1212
|
+
remoteEntryInitOptions: a,
|
|
1213
|
+
shareScope: r[i[0]],
|
|
1214
|
+
initScope: n ?? []
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
var gn = class {
|
|
1218
|
+
constructor({ remoteInfo: e, host: t }) {
|
|
1219
|
+
this.inited = !1, this.initing = !1, this.lib = void 0, this.remoteInfo = e, this.host = t;
|
|
1220
|
+
}
|
|
1221
|
+
async getEntry() {
|
|
1222
|
+
if (this.remoteEntryExports) return this.remoteEntryExports;
|
|
1223
|
+
let e = await sn({
|
|
1224
|
+
origin: this.host,
|
|
1225
|
+
remoteInfo: this.remoteInfo,
|
|
1226
|
+
remoteEntryExports: this.remoteEntryExports
|
|
1227
|
+
});
|
|
1228
|
+
return v(e, `remoteEntryExports is undefined \n ${f(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
|
|
1229
|
+
}
|
|
1230
|
+
async init(e, t, n) {
|
|
1231
|
+
let r = await this.getEntry();
|
|
1232
|
+
if (this.inited) return r;
|
|
1233
|
+
if (this.initPromise) return await this.initPromise, r;
|
|
1234
|
+
this.initing = !0, this.initPromise = (async () => {
|
|
1235
|
+
let { remoteEntryInitOptions: i, shareScope: a, initScope: o } = hn(this.remoteInfo, this.host.shareScopeMap, n), s = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1236
|
+
shareScope: a,
|
|
1237
|
+
remoteEntryInitOptions: i,
|
|
1238
|
+
initScope: o,
|
|
1239
|
+
remoteInfo: this.remoteInfo,
|
|
1240
|
+
origin: this.host
|
|
1241
|
+
});
|
|
1242
|
+
r?.init === void 0 && y(Lt, K, {
|
|
1243
|
+
hostName: this.host.name,
|
|
1244
|
+
remoteName: this.remoteInfo.name,
|
|
1245
|
+
remoteEntryUrl: this.remoteInfo.entry,
|
|
1246
|
+
remoteEntryKey: this.remoteInfo.entryGlobalName
|
|
1247
|
+
}, void 0, J(this.host.options)), await r.init(s.shareScope, s.initScope, s.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
|
|
1248
|
+
...s,
|
|
1249
|
+
id: e,
|
|
1250
|
+
remoteSnapshot: t,
|
|
1251
|
+
remoteEntryExports: r
|
|
1252
|
+
}), this.inited = !0;
|
|
1253
|
+
})();
|
|
1254
|
+
try {
|
|
1255
|
+
await this.initPromise;
|
|
1256
|
+
} finally {
|
|
1257
|
+
this.initing = !1, this.initPromise = void 0;
|
|
1258
|
+
}
|
|
1259
|
+
return r;
|
|
1260
|
+
}
|
|
1261
|
+
async get(e, t, n, r) {
|
|
1262
|
+
let { loadFactory: i = !0 } = n || { loadFactory: !0 }, a = await this.init(e, r);
|
|
1263
|
+
this.lib = a;
|
|
1264
|
+
let o;
|
|
1265
|
+
o = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
|
|
1266
|
+
remoteEntryExports: a,
|
|
1267
|
+
expose: t,
|
|
1268
|
+
moduleInfo: this.remoteInfo
|
|
1269
|
+
}), o ||= await a.get(t), v(o, `${b(this.remoteInfo)} remote don't export ${t}.`);
|
|
1270
|
+
let s = Te(this.remoteInfo.name, t), c = this.wraperFactory(o, s);
|
|
1271
|
+
return i ? await c() : c;
|
|
1272
|
+
}
|
|
1273
|
+
wraperFactory(e, t) {
|
|
1274
|
+
function n(e, t) {
|
|
1275
|
+
e && typeof e == "object" && Object.isExtensible(e) && !Object.getOwnPropertyDescriptor(e, Symbol.for("mf_module_id")) && Object.defineProperty(e, Symbol.for("mf_module_id"), {
|
|
1276
|
+
value: t,
|
|
1277
|
+
enumerable: !1
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
return e instanceof Promise ? async () => {
|
|
1281
|
+
let r = await e();
|
|
1282
|
+
return n(r, t), r;
|
|
1283
|
+
} : () => {
|
|
1284
|
+
let r = e();
|
|
1285
|
+
return n(r, t), r;
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
}, Y = class {
|
|
1289
|
+
constructor(e) {
|
|
1290
|
+
this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
|
|
1291
|
+
}
|
|
1292
|
+
on(e) {
|
|
1293
|
+
typeof e == "function" && this.listeners.add(e);
|
|
1294
|
+
}
|
|
1295
|
+
once(e) {
|
|
1296
|
+
let t = this;
|
|
1297
|
+
this.on(function n(...r) {
|
|
1298
|
+
return t.remove(n), e.apply(null, r);
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
emit(...e) {
|
|
1302
|
+
let t;
|
|
1303
|
+
return this.listeners.size > 0 && this.listeners.forEach((n) => {
|
|
1304
|
+
t = n(...e);
|
|
1305
|
+
}), t;
|
|
1306
|
+
}
|
|
1307
|
+
remove(e) {
|
|
1308
|
+
this.listeners.delete(e);
|
|
1309
|
+
}
|
|
1310
|
+
removeAll() {
|
|
1311
|
+
this.listeners.clear();
|
|
1312
|
+
}
|
|
1313
|
+
}, X = class extends Y {
|
|
1314
|
+
emit(...e) {
|
|
1315
|
+
let t, n = Array.from(this.listeners);
|
|
1316
|
+
if (n.length > 0) {
|
|
1317
|
+
let r = 0, i = (t) => t === !1 ? !1 : r < n.length ? Promise.resolve(n[r++].apply(null, e)).then(i) : t;
|
|
1318
|
+
t = i();
|
|
1319
|
+
}
|
|
1320
|
+
return Promise.resolve(t);
|
|
1321
|
+
}
|
|
1322
|
+
};
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/utils/hooks/syncWaterfallHook.js
|
|
1325
|
+
function _n(e, t) {
|
|
1326
|
+
if (!be(t)) return !1;
|
|
1327
|
+
if (e !== t) {
|
|
1328
|
+
for (let n in e) if (!(n in t)) return !1;
|
|
1329
|
+
}
|
|
1330
|
+
return !0;
|
|
1331
|
+
}
|
|
1332
|
+
var Z = class extends Y {
|
|
1333
|
+
constructor(e) {
|
|
1334
|
+
super(), this.onerror = y, this.type = e;
|
|
1335
|
+
}
|
|
1336
|
+
emit(e) {
|
|
1337
|
+
be(e) || y(`The data for the "${this.type}" hook should be an object.`);
|
|
1338
|
+
for (let t of this.listeners) try {
|
|
1339
|
+
let n = t(e);
|
|
1340
|
+
if (_n(e, n)) e = n;
|
|
1341
|
+
else {
|
|
1342
|
+
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
|
|
1343
|
+
break;
|
|
1344
|
+
}
|
|
1345
|
+
} catch (e) {
|
|
1346
|
+
ge(e), this.onerror(e);
|
|
1347
|
+
}
|
|
1348
|
+
return e;
|
|
1349
|
+
}
|
|
1350
|
+
}, Q = class extends Y {
|
|
1351
|
+
constructor(e) {
|
|
1352
|
+
super(), this.onerror = y, this.type = e;
|
|
1353
|
+
}
|
|
1354
|
+
emit(e) {
|
|
1355
|
+
be(e) || y(`The response data for the "${this.type}" hook must be an object.`);
|
|
1356
|
+
let t = Array.from(this.listeners);
|
|
1357
|
+
if (t.length > 0) {
|
|
1358
|
+
let n = 0, r = (t) => (ge(t), this.onerror(t), e), i = (a) => {
|
|
1359
|
+
if (_n(e, a)) {
|
|
1360
|
+
if (e = a, n < t.length) try {
|
|
1361
|
+
return Promise.resolve(t[n++](e)).then(i, r);
|
|
1362
|
+
} catch (e) {
|
|
1363
|
+
return r(e);
|
|
1364
|
+
}
|
|
1365
|
+
} else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
|
|
1366
|
+
return e;
|
|
1367
|
+
};
|
|
1368
|
+
return Promise.resolve(i(e));
|
|
1369
|
+
}
|
|
1370
|
+
return Promise.resolve(e);
|
|
1371
|
+
}
|
|
1372
|
+
}, $ = class {
|
|
1373
|
+
constructor(e) {
|
|
1374
|
+
this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
|
|
1375
|
+
}
|
|
1376
|
+
applyPlugin(e, t) {
|
|
1377
|
+
v(Se(e), "Plugin configuration is invalid.");
|
|
1378
|
+
let n = e.name;
|
|
1379
|
+
v(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) => {
|
|
1380
|
+
let n = e[t];
|
|
1381
|
+
n && this.lifecycle[t].on(n);
|
|
1382
|
+
}));
|
|
1383
|
+
}
|
|
1384
|
+
removePlugin(e) {
|
|
1385
|
+
v(e, "A name is required.");
|
|
1386
|
+
let t = this.registerPlugins[e];
|
|
1387
|
+
v(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((e) => {
|
|
1388
|
+
e !== "name" && this.lifecycle[e].remove(t[e]);
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
};
|
|
1392
|
+
//#endregion
|
|
1393
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/plugins/snapshot/index.js
|
|
1394
|
+
function vn(e, t) {
|
|
1395
|
+
let n = we(t);
|
|
1396
|
+
n.url || y(Kt, K, { remoteName: e.name });
|
|
1397
|
+
let r = u(t, n.url);
|
|
1398
|
+
e.type = n.type, e.entryGlobalName = n.globalName, e.entry = r, e.version = t.version, e.buildVersion = t.buildVersion;
|
|
1399
|
+
}
|
|
1400
|
+
function yn() {
|
|
1401
|
+
return {
|
|
1402
|
+
name: "snapshot-plugin",
|
|
1403
|
+
async afterResolve(e) {
|
|
1404
|
+
let { remote: t, pkgNameOrAlias: n, expose: r, origin: i, remoteInfo: a, id: o } = e;
|
|
1405
|
+
if (!ve(t) || !ye(t)) {
|
|
1406
|
+
let { remoteSnapshot: s, globalSnapshot: c } = await i.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1407
|
+
moduleInfo: t,
|
|
1408
|
+
id: o
|
|
1409
|
+
});
|
|
1410
|
+
vn(a, s);
|
|
1411
|
+
let l = {
|
|
1412
|
+
remote: t,
|
|
1413
|
+
preloadConfig: {
|
|
1414
|
+
nameOrAlias: n,
|
|
1415
|
+
exposes: [r],
|
|
1416
|
+
resourceCategory: "sync",
|
|
1417
|
+
share: !1,
|
|
1418
|
+
depsRemote: !1
|
|
1419
|
+
}
|
|
1420
|
+
}, u = await i.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1421
|
+
origin: i,
|
|
1422
|
+
preloadOptions: l,
|
|
1423
|
+
remoteInfo: a,
|
|
1424
|
+
remote: t,
|
|
1425
|
+
remoteSnapshot: s,
|
|
1426
|
+
globalSnapshot: c
|
|
1427
|
+
});
|
|
1428
|
+
return u && mn(a, i, u, !1), {
|
|
1429
|
+
...e,
|
|
1430
|
+
remoteSnapshot: s
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
return e;
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
//#endregion
|
|
1438
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/plugins/generate-preload-assets.js
|
|
1439
|
+
function bn(e) {
|
|
1440
|
+
let t = e.split(":");
|
|
1441
|
+
return t.length === 1 ? {
|
|
1442
|
+
name: t[0],
|
|
1443
|
+
version: void 0
|
|
1444
|
+
} : t.length === 2 ? {
|
|
1445
|
+
name: t[0],
|
|
1446
|
+
version: t[1]
|
|
1447
|
+
} : {
|
|
1448
|
+
name: t[1],
|
|
1449
|
+
version: t[2]
|
|
1450
|
+
};
|
|
1451
|
+
}
|
|
1452
|
+
function xn(e, t, n, r, i = {}, a) {
|
|
1453
|
+
let { value: o } = D(e, b(t)), s = a || o;
|
|
1454
|
+
if (s && !te(s) && (n(s, t, r), s.remotesInfo)) {
|
|
1455
|
+
let t = Object.keys(s.remotesInfo);
|
|
1456
|
+
for (let r of t) {
|
|
1457
|
+
if (i[r]) continue;
|
|
1458
|
+
i[r] = !0;
|
|
1459
|
+
let t = bn(r), a = s.remotesInfo[r];
|
|
1460
|
+
xn(e, {
|
|
1461
|
+
name: t.name,
|
|
1462
|
+
version: a.matchedVersion
|
|
1463
|
+
}, n, !1, i, void 0);
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
var Sn = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1468
|
+
function Cn(e, t, n, r, i) {
|
|
1469
|
+
let a = [], o = [], s = [], c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: d } = e, { preloadConfig: f } = t, { depsRemote: p } = f;
|
|
1470
|
+
if (xn(r, n, (t, n, r) => {
|
|
1471
|
+
let i;
|
|
1472
|
+
if (r) i = f;
|
|
1473
|
+
else if (Array.isArray(p)) {
|
|
1474
|
+
let e = p.find((e) => e.nameOrAlias === n.name || e.nameOrAlias === n.alias);
|
|
1475
|
+
if (!e) return;
|
|
1476
|
+
i = dn(e);
|
|
1477
|
+
} else if (p === !0) i = f;
|
|
1478
|
+
else return;
|
|
1479
|
+
let c = u(t, we(t).url);
|
|
1480
|
+
c && s.push({
|
|
1481
|
+
name: n.name,
|
|
1482
|
+
moduleInfo: {
|
|
1483
|
+
name: n.name,
|
|
1484
|
+
entry: c,
|
|
1485
|
+
type: "remoteEntryType" in t ? t.remoteEntryType : "global",
|
|
1486
|
+
entryGlobalName: "globalName" in t ? t.globalName : n.name,
|
|
1487
|
+
shareScope: "",
|
|
1488
|
+
version: "version" in t ? t.version : void 0
|
|
1489
|
+
},
|
|
1490
|
+
url: c
|
|
1491
|
+
});
|
|
1492
|
+
let l = "modules" in t ? t.modules : [], d = pn(i.exposes);
|
|
1493
|
+
d.length && "modules" in t && (l = t?.modules?.reduce((e, t) => (d?.indexOf(t.moduleName) !== -1 && e.push(t), e), []));
|
|
1494
|
+
function m(e) {
|
|
1495
|
+
let n = e.map((e) => u(t, e));
|
|
1496
|
+
return i.filter ? n.filter(i.filter) : n;
|
|
1497
|
+
}
|
|
1498
|
+
if (l) {
|
|
1499
|
+
let r = l.length;
|
|
1500
|
+
for (let s = 0; s < r; s++) {
|
|
1501
|
+
let r = l[s], c = `${n.name}/${r.moduleName}`;
|
|
1502
|
+
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1503
|
+
id: r.moduleName === "." ? n.name : c,
|
|
1504
|
+
name: n.name,
|
|
1505
|
+
remoteSnapshot: t,
|
|
1506
|
+
preloadConfig: i,
|
|
1507
|
+
remote: n,
|
|
1508
|
+
origin: e
|
|
1509
|
+
}), !Ie(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))), Le(c));
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
}, !0, {}, i), i.shared && i.shared.length > 0) {
|
|
1513
|
+
let t = (t, n) => {
|
|
1514
|
+
let { shared: r } = U(e.shareScopeMap, n.sharedName, t, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
1515
|
+
r && typeof r.lib == "function" && (n.assets.js.sync.forEach((e) => {
|
|
1516
|
+
c.add(e);
|
|
1517
|
+
}), n.assets.css.sync.forEach((e) => {
|
|
1518
|
+
l.add(e);
|
|
1519
|
+
}));
|
|
1520
|
+
};
|
|
1521
|
+
i.shared.forEach((e) => {
|
|
1522
|
+
let n = d.shared?.[e.sharedName];
|
|
1523
|
+
if (!n) return;
|
|
1524
|
+
let r = e.version ? n.find((t) => t.version === e.version) : n;
|
|
1525
|
+
r && Ce(r).forEach((n) => {
|
|
1526
|
+
t(n, e);
|
|
1527
|
+
});
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
let m = o.filter((e) => !c.has(e) && !Sn("script", e));
|
|
1531
|
+
return {
|
|
1532
|
+
cssAssets: a.filter((e) => !l.has(e) && !Sn("link", e)),
|
|
1533
|
+
jsAssetsWithoutEntry: m,
|
|
1534
|
+
entryAssets: s.filter((e) => !Sn("script", e.url))
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
var wn = function() {
|
|
1538
|
+
return {
|
|
1539
|
+
name: "generate-preload-assets-plugin",
|
|
1540
|
+
async generatePreloadAssets(e) {
|
|
1541
|
+
let { origin: t, preloadOptions: n, remoteInfo: r, remote: i, globalSnapshot: a, remoteSnapshot: o } = e;
|
|
1542
|
+
return ve(i) && ye(i) ? {
|
|
1543
|
+
cssAssets: [],
|
|
1544
|
+
jsAssetsWithoutEntry: [],
|
|
1545
|
+
entryAssets: [{
|
|
1546
|
+
name: i.name,
|
|
1547
|
+
url: i.entry,
|
|
1548
|
+
moduleInfo: {
|
|
1549
|
+
name: r.name,
|
|
1550
|
+
entry: i.entry,
|
|
1551
|
+
type: r.type || "global",
|
|
1552
|
+
entryGlobalName: "",
|
|
1553
|
+
shareScope: ""
|
|
1554
|
+
}
|
|
1555
|
+
}]
|
|
1556
|
+
} : (vn(r, o), Cn(t, n, r, a, o));
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
};
|
|
1560
|
+
//#endregion
|
|
1561
|
+
//#region ../../node_modules/@module-federation/runtime-core/dist/plugins/snapshot/SnapshotHandler.js
|
|
1562
|
+
function Tn(e, t) {
|
|
1563
|
+
let n = O({
|
|
1564
|
+
name: t.name,
|
|
1565
|
+
version: t.options.version
|
|
1566
|
+
}), r = n && "remotesInfo" in n && n.remotesInfo && D(n.remotesInfo, e.name).value;
|
|
1567
|
+
return r && r.matchedVersion ? {
|
|
1568
|
+
hostGlobalSnapshot: n,
|
|
1569
|
+
globalSnapshot: Ae(),
|
|
1570
|
+
remoteSnapshot: O({
|
|
1571
|
+
name: e.name,
|
|
1572
|
+
version: r.matchedVersion
|
|
1573
|
+
})
|
|
1574
|
+
} : {
|
|
1575
|
+
hostGlobalSnapshot: void 0,
|
|
1576
|
+
globalSnapshot: Ae(),
|
|
1577
|
+
remoteSnapshot: O({
|
|
1578
|
+
name: e.name,
|
|
1579
|
+
version: "version" in e ? e.version : void 0
|
|
1580
|
+
})
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
var En = class {
|
|
1584
|
+
constructor(e) {
|
|
1585
|
+
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new $({
|
|
1586
|
+
beforeLoadRemoteSnapshot: new X("beforeLoadRemoteSnapshot"),
|
|
1587
|
+
loadSnapshot: new Q("loadGlobalSnapshot"),
|
|
1588
|
+
loadRemoteSnapshot: new Q("loadRemoteSnapshot"),
|
|
1589
|
+
afterLoadSnapshot: new Q("afterLoadSnapshot")
|
|
1590
|
+
}), this.manifestLoading = C.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
|
|
1591
|
+
}
|
|
1592
|
+
async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, expose: n }) {
|
|
1593
|
+
let { options: r } = this.HostInstance;
|
|
1594
|
+
await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
|
|
1595
|
+
options: r,
|
|
1596
|
+
moduleInfo: e
|
|
1597
|
+
});
|
|
1598
|
+
let i = O({
|
|
1599
|
+
name: this.HostInstance.options.name,
|
|
1600
|
+
version: this.HostInstance.options.version
|
|
1601
|
+
});
|
|
1602
|
+
i || (i = {
|
|
1603
|
+
version: this.HostInstance.options.version || "",
|
|
1604
|
+
remoteEntry: "",
|
|
1605
|
+
remotesInfo: {}
|
|
1606
|
+
}, Ne({ [this.HostInstance.options.name]: i })), i && "remotesInfo" in i && !D(i.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (i.remotesInfo = {
|
|
1607
|
+
...i?.remotesInfo,
|
|
1608
|
+
[e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
|
|
1609
|
+
});
|
|
1610
|
+
let { hostGlobalSnapshot: a, remoteSnapshot: o, globalSnapshot: s } = this.getGlobalRemoteInfo(e), { remoteSnapshot: c, globalSnapshot: l } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
1611
|
+
options: r,
|
|
1612
|
+
moduleInfo: e,
|
|
1613
|
+
hostGlobalSnapshot: a,
|
|
1614
|
+
remoteSnapshot: o,
|
|
1615
|
+
globalSnapshot: s
|
|
1616
|
+
}), u, d;
|
|
1617
|
+
if (c) if (te(c)) {
|
|
1618
|
+
let t = c.remoteEntry, n = await this.getManifestJson(t, e, {}), r = Me({
|
|
1619
|
+
...e,
|
|
1620
|
+
entry: t
|
|
1621
|
+
}, n);
|
|
1622
|
+
u = n, d = r;
|
|
1623
|
+
} else {
|
|
1624
|
+
let { remoteSnapshot: t } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1625
|
+
options: this.HostInstance.options,
|
|
1626
|
+
moduleInfo: e,
|
|
1627
|
+
remoteSnapshot: c,
|
|
1628
|
+
from: "global"
|
|
1629
|
+
});
|
|
1630
|
+
u = t, d = l;
|
|
1631
|
+
}
|
|
1632
|
+
else if (ve(e)) {
|
|
1633
|
+
let t = await this.getManifestJson(e.entry, e, {}), n = Me(e, t), { remoteSnapshot: r } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1634
|
+
options: this.HostInstance.options,
|
|
1635
|
+
moduleInfo: e,
|
|
1636
|
+
remoteSnapshot: t,
|
|
1637
|
+
from: "global"
|
|
1638
|
+
});
|
|
1639
|
+
u = r, d = n;
|
|
1640
|
+
} else y(Ht, K, {
|
|
1641
|
+
remoteName: e.name,
|
|
1642
|
+
remoteVersion: e.version,
|
|
1643
|
+
hostName: this.HostInstance.options.name,
|
|
1644
|
+
globalSnapshot: JSON.stringify(l)
|
|
1645
|
+
}, void 0, J(this.HostInstance.options));
|
|
1646
|
+
return await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
1647
|
+
id: t,
|
|
1648
|
+
host: this.HostInstance,
|
|
1649
|
+
options: r,
|
|
1650
|
+
moduleInfo: e,
|
|
1651
|
+
remoteSnapshot: u
|
|
1652
|
+
}), {
|
|
1653
|
+
remoteSnapshot: u,
|
|
1654
|
+
globalSnapshot: d
|
|
1655
|
+
};
|
|
1656
|
+
}
|
|
1657
|
+
getGlobalRemoteInfo(e) {
|
|
1658
|
+
return Tn(e, this.HostInstance);
|
|
1659
|
+
}
|
|
1660
|
+
async getManifestJson(e, t, n) {
|
|
1661
|
+
let r = async () => {
|
|
1662
|
+
let n = this.manifestCache.get(e);
|
|
1663
|
+
if (n) return n;
|
|
1664
|
+
try {
|
|
1665
|
+
let r = await this.loaderHook.lifecycle.fetch.emit(e, {}, q(t));
|
|
1666
|
+
(!r || !(r instanceof Response)) && (r = await fetch(e, {})), n = await r.json();
|
|
1667
|
+
} catch (r) {
|
|
1668
|
+
n = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
1669
|
+
id: e,
|
|
1670
|
+
error: r,
|
|
1671
|
+
from: "runtime",
|
|
1672
|
+
lifecycle: "afterResolve",
|
|
1673
|
+
origin: this.HostInstance
|
|
1674
|
+
}), n || (delete this.manifestLoading[e], y(Rt, K, {
|
|
1675
|
+
manifestUrl: e,
|
|
1676
|
+
moduleName: t.name,
|
|
1677
|
+
hostName: this.HostInstance.options.name
|
|
1678
|
+
}, `${r}`, J(this.HostInstance.options)));
|
|
1679
|
+
}
|
|
1680
|
+
return v(n.metaData && n.exposes && n.shared, `"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[
|
|
1681
|
+
!n.metaData && "metaData",
|
|
1682
|
+
!n.exposes && "exposes",
|
|
1683
|
+
!n.shared && "shared"
|
|
1684
|
+
].filter(Boolean).join(", ")}.`), this.manifestCache.set(e, n), n;
|
|
1685
|
+
}, i = async () => {
|
|
1686
|
+
let n = await r(), i = ee(n, { version: e }), { remoteSnapshot: a } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1687
|
+
options: this.HostInstance.options,
|
|
1688
|
+
moduleInfo: t,
|
|
1689
|
+
manifestJson: n,
|
|
1690
|
+
remoteSnapshot: i,
|
|
1691
|
+
manifestUrl: e,
|
|
1692
|
+
from: "manifest"
|
|
1693
|
+
});
|
|
1694
|
+
return a;
|
|
1695
|
+
};
|
|
1696
|
+
return this.manifestLoading[e] || (this.manifestLoading[e] = i().then((e) => e)), this.manifestLoading[e];
|
|
1697
|
+
}
|
|
1698
|
+
}, Dn = class {
|
|
1699
|
+
constructor(e) {
|
|
1700
|
+
this.hooks = new $({
|
|
1701
|
+
beforeRegisterShare: new Z("beforeRegisterShare"),
|
|
1702
|
+
afterResolve: new Q("afterResolve"),
|
|
1703
|
+
beforeLoadShare: new Q("beforeLoadShare"),
|
|
1704
|
+
loadShare: new X(),
|
|
1705
|
+
resolveShare: new Z("resolveShare"),
|
|
1706
|
+
initContainerShareScopeMap: new Z("initContainerShareScopeMap")
|
|
1707
|
+
}), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
|
|
1708
|
+
}
|
|
1709
|
+
registerShared(e, t) {
|
|
1710
|
+
let { newShareInfos: n, allShareInfos: r } = Et(e, t);
|
|
1711
|
+
return Object.keys(n).forEach((e) => {
|
|
1712
|
+
n[e].forEach((n) => {
|
|
1713
|
+
n.scope.forEach((r) => {
|
|
1714
|
+
this.hooks.lifecycle.beforeRegisterShare.emit({
|
|
1715
|
+
origin: this.host,
|
|
1716
|
+
pkgName: e,
|
|
1717
|
+
shared: n
|
|
1718
|
+
}), this.shareScopeMap[r]?.[e] || this.setShared({
|
|
1719
|
+
pkgName: e,
|
|
1720
|
+
lib: n.lib,
|
|
1721
|
+
get: n.get,
|
|
1722
|
+
loaded: n.loaded || !!n.lib,
|
|
1723
|
+
shared: n,
|
|
1724
|
+
from: t.name
|
|
1725
|
+
});
|
|
1726
|
+
});
|
|
1727
|
+
});
|
|
1728
|
+
}), {
|
|
1729
|
+
newShareInfos: n,
|
|
1730
|
+
allShareInfos: r
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
async loadShare(e, t) {
|
|
1734
|
+
let { host: n } = this, r = Nt({
|
|
1735
|
+
pkgName: e,
|
|
1736
|
+
extraOptions: t,
|
|
1737
|
+
shareInfos: n.options.shared
|
|
1738
|
+
});
|
|
1739
|
+
r?.scope && await Promise.all(r.scope.map(async (e) => {
|
|
1740
|
+
await Promise.all(this.initializeSharing(e, { strategy: r.strategy }));
|
|
1741
|
+
}));
|
|
1742
|
+
let { shareInfo: i } = await this.hooks.lifecycle.beforeLoadShare.emit({
|
|
1743
|
+
pkgName: e,
|
|
1744
|
+
shareInfo: r,
|
|
1745
|
+
shared: n.options.shared,
|
|
1746
|
+
origin: n
|
|
1747
|
+
});
|
|
1748
|
+
v(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.`);
|
|
1749
|
+
let { shared: a, useTreesShaking: o } = U(this.shareScopeMap, e, i, this.hooks.lifecycle.resolveShare) || {};
|
|
1750
|
+
if (a) {
|
|
1751
|
+
let t = G(a, o);
|
|
1752
|
+
if (t.lib) return W(t, n.options.name), t.lib;
|
|
1753
|
+
if (t.loading && !t.loaded) {
|
|
1754
|
+
let e = await t.loading;
|
|
1755
|
+
return t.loaded = !0, t.lib ||= e, W(t, n.options.name), e;
|
|
1756
|
+
} else {
|
|
1757
|
+
let r = (async () => {
|
|
1758
|
+
let e = await t.get();
|
|
1759
|
+
return W(t, n.options.name), t.loaded = !0, t.lib = e, e;
|
|
1760
|
+
})();
|
|
1761
|
+
return this.setShared({
|
|
1762
|
+
pkgName: e,
|
|
1763
|
+
loaded: !1,
|
|
1764
|
+
shared: a,
|
|
1765
|
+
from: n.options.name,
|
|
1766
|
+
lib: null,
|
|
1767
|
+
loading: r,
|
|
1768
|
+
treeShaking: o ? t : void 0
|
|
1769
|
+
}), r;
|
|
1770
|
+
}
|
|
1771
|
+
} else {
|
|
1772
|
+
if (t?.customShareInfo) return !1;
|
|
1773
|
+
let r = R(i.treeShaking), a = G(i, r), o = (async () => {
|
|
1774
|
+
let t = await a.get();
|
|
1775
|
+
a.lib = t, a.loaded = !0, W(a, n.options.name);
|
|
1776
|
+
let { shared: r, useTreesShaking: o } = U(this.shareScopeMap, e, i, this.hooks.lifecycle.resolveShare) || {};
|
|
1777
|
+
if (r) {
|
|
1778
|
+
let e = G(r, o);
|
|
1779
|
+
e.lib = t, e.loaded = !0, r.from = i.from;
|
|
1780
|
+
}
|
|
1781
|
+
return t;
|
|
1782
|
+
})();
|
|
1783
|
+
return this.setShared({
|
|
1784
|
+
pkgName: e,
|
|
1785
|
+
loaded: !1,
|
|
1786
|
+
shared: i,
|
|
1787
|
+
from: n.options.name,
|
|
1788
|
+
lib: null,
|
|
1789
|
+
loading: o,
|
|
1790
|
+
treeShaking: r ? a : void 0
|
|
1791
|
+
}), o;
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
initializeSharing(e = L, t) {
|
|
1795
|
+
let { host: n } = this, r = t?.from, i = t?.strategy, a = t?.initScope, o = [];
|
|
1796
|
+
if (r !== "build") {
|
|
1797
|
+
let { initTokens: t } = this;
|
|
1798
|
+
a ||= [];
|
|
1799
|
+
let n = t[e];
|
|
1800
|
+
if (n ||= t[e] = { from: this.host.name }, a.indexOf(n) >= 0) return o;
|
|
1801
|
+
a.push(n);
|
|
1802
|
+
}
|
|
1803
|
+
let s = this.shareScopeMap, c = n.options.name;
|
|
1804
|
+
s[e] || (s[e] = {});
|
|
1805
|
+
let l = s[e], u = (e, t) => {
|
|
1806
|
+
let { version: n, eager: r } = t;
|
|
1807
|
+
l[e] = l[e] || {};
|
|
1808
|
+
let i = l[e], a = i[n] && G(i[n]), o = !!(a && ("eager" in a && a.eager || "shareConfig" in a && a.shareConfig?.eager));
|
|
1809
|
+
(!a || a.strategy !== "loaded-first" && !a.loaded && (!r == !o ? c > i[n].from : r)) && (i[n] = t);
|
|
1810
|
+
}, d = async (e) => {
|
|
1811
|
+
let { module: t } = await n.remoteHandler.getRemoteModuleAndOptions({ id: e }), r;
|
|
1812
|
+
try {
|
|
1813
|
+
r = await t.getEntry();
|
|
1814
|
+
} catch (t) {
|
|
1815
|
+
if (r = await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
1816
|
+
id: e,
|
|
1817
|
+
error: t,
|
|
1818
|
+
from: "runtime",
|
|
1819
|
+
lifecycle: "beforeLoadShare",
|
|
1820
|
+
origin: n
|
|
1821
|
+
}), !r) return;
|
|
1822
|
+
} finally {
|
|
1823
|
+
r?.init && !t.initing && (t.remoteEntryExports = r, await t.init(void 0, void 0, a));
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
return Object.keys(n.options.shared).forEach((t) => {
|
|
1827
|
+
n.options.shared[t].forEach((n) => {
|
|
1828
|
+
n.scope.includes(e) && u(t, n);
|
|
1829
|
+
});
|
|
1830
|
+
}), (n.options.shareStrategy === "version-first" || i === "version-first") && n.options.remotes.forEach((t) => {
|
|
1831
|
+
t.shareScope === e && o.push(d(t.name));
|
|
1832
|
+
}), o;
|
|
1833
|
+
}
|
|
1834
|
+
loadShareSync(e, t) {
|
|
1835
|
+
let { host: n } = this, r = Nt({
|
|
1836
|
+
pkgName: e,
|
|
1837
|
+
extraOptions: t,
|
|
1838
|
+
shareInfos: n.options.shared
|
|
1839
|
+
});
|
|
1840
|
+
r?.scope && r.scope.forEach((e) => {
|
|
1841
|
+
this.initializeSharing(e, { strategy: r.strategy });
|
|
1842
|
+
});
|
|
1843
|
+
let { shared: i, useTreesShaking: a } = U(this.shareScopeMap, e, r, this.hooks.lifecycle.resolveShare) || {};
|
|
1844
|
+
if (i) {
|
|
1845
|
+
if (typeof i.lib == "function") return W(i, n.options.name), i.loaded || (i.loaded = !0, i.from === n.options.name && (r.loaded = !0)), i.lib;
|
|
1846
|
+
if (typeof i.get == "function") {
|
|
1847
|
+
let t = i.get();
|
|
1848
|
+
if (!(t instanceof Promise)) return W(i, n.options.name), this.setShared({
|
|
1849
|
+
pkgName: e,
|
|
1850
|
+
loaded: !0,
|
|
1851
|
+
from: n.options.name,
|
|
1852
|
+
lib: t,
|
|
1853
|
+
shared: i
|
|
1854
|
+
}), t;
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
if (r.lib) return r.loaded ||= !0, r.lib;
|
|
1858
|
+
if (r.get) {
|
|
1859
|
+
let i = r.get();
|
|
1860
|
+
return i instanceof Promise && y(t?.from === "build" ? Bt : Vt, K, {
|
|
1861
|
+
hostName: n.options.name,
|
|
1862
|
+
sharedPkgName: e
|
|
1863
|
+
}, void 0, J(n.options)), r.lib = i, this.setShared({
|
|
1864
|
+
pkgName: e,
|
|
1865
|
+
loaded: !0,
|
|
1866
|
+
from: n.options.name,
|
|
1867
|
+
lib: r.lib,
|
|
1868
|
+
shared: r
|
|
1869
|
+
}), r.lib;
|
|
1870
|
+
}
|
|
1871
|
+
y(Vt, K, {
|
|
1872
|
+
hostName: n.options.name,
|
|
1873
|
+
sharedPkgName: e
|
|
1874
|
+
}, void 0, J(n.options));
|
|
1875
|
+
}
|
|
1876
|
+
initShareScopeMap(e, t, n = {}) {
|
|
1877
|
+
let { host: r } = this;
|
|
1878
|
+
this.shareScopeMap[e] = t, this.hooks.lifecycle.initContainerShareScopeMap.emit({
|
|
1879
|
+
shareScope: t,
|
|
1880
|
+
options: r.options,
|
|
1881
|
+
origin: r,
|
|
1882
|
+
scopeName: e,
|
|
1883
|
+
hostShareScopeMap: n.hostShareScopeMap
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
setShared({ pkgName: e, shared: t, from: n, lib: r, loading: i, loaded: a, get: o, treeShaking: s }) {
|
|
1887
|
+
let { version: c, scope: l = "default", ...u } = t, d = Array.isArray(l) ? l : [l], f = (e) => {
|
|
1888
|
+
let t = (e, t, n) => {
|
|
1889
|
+
n && !e[t] && (e[t] = n);
|
|
1890
|
+
}, n = s ? e.treeShaking : e;
|
|
1891
|
+
t(n, "loaded", a), t(n, "loading", i), t(n, "get", o);
|
|
1892
|
+
};
|
|
1893
|
+
d.forEach((t) => {
|
|
1894
|
+
this.shareScopeMap[t] || (this.shareScopeMap[t] = {}), this.shareScopeMap[t][e] || (this.shareScopeMap[t][e] = {}), this.shareScopeMap[t][e][c] || (this.shareScopeMap[t][e][c] = {
|
|
1895
|
+
version: c,
|
|
1896
|
+
scope: [t],
|
|
1897
|
+
...u,
|
|
1898
|
+
lib: r
|
|
1899
|
+
});
|
|
1900
|
+
let i = this.shareScopeMap[t][e][c];
|
|
1901
|
+
f(i), n && i.from !== n && (i.from = n);
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
_setGlobalShareScopeMap(e) {
|
|
1905
|
+
let t = Mt(), n = e.id || e.name;
|
|
1906
|
+
n && !t[n] && (t[n] = this.shareScopeMap);
|
|
1907
|
+
}
|
|
1908
|
+
}, On = class {
|
|
1909
|
+
constructor(e) {
|
|
1910
|
+
this.hooks = new $({
|
|
1911
|
+
beforeRegisterRemote: new Z("beforeRegisterRemote"),
|
|
1912
|
+
registerRemote: new Z("registerRemote"),
|
|
1913
|
+
beforeRequest: new Q("beforeRequest"),
|
|
1914
|
+
onLoad: new X("onLoad"),
|
|
1915
|
+
handlePreloadModule: new Y("handlePreloadModule"),
|
|
1916
|
+
errorLoadRemote: new X("errorLoadRemote"),
|
|
1917
|
+
beforePreloadRemote: new X("beforePreloadRemote"),
|
|
1918
|
+
generatePreloadAssets: new X("generatePreloadAssets"),
|
|
1919
|
+
afterPreloadRemote: new X(),
|
|
1920
|
+
loadEntry: new X()
|
|
1921
|
+
}), this.host = e, this.idToRemoteMap = {};
|
|
1922
|
+
}
|
|
1923
|
+
formatAndRegisterRemote(e, t) {
|
|
1924
|
+
return (t.remotes || []).reduce((e, t) => (this.registerRemote(t, e, { force: !1 }), e), e.remotes);
|
|
1925
|
+
}
|
|
1926
|
+
setIdToRemoteMap(e, t) {
|
|
1927
|
+
let { remote: n, expose: r } = t, { name: i, alias: a } = n;
|
|
1928
|
+
if (this.idToRemoteMap[e] = {
|
|
1929
|
+
name: n.name,
|
|
1930
|
+
expose: r
|
|
1931
|
+
}, a && e.startsWith(i)) {
|
|
1932
|
+
let t = e.replace(i, a);
|
|
1933
|
+
this.idToRemoteMap[t] = {
|
|
1934
|
+
name: n.name,
|
|
1935
|
+
expose: r
|
|
1936
|
+
};
|
|
1937
|
+
return;
|
|
1938
|
+
}
|
|
1939
|
+
if (a && e.startsWith(a)) {
|
|
1940
|
+
let t = e.replace(a, i);
|
|
1941
|
+
this.idToRemoteMap[t] = {
|
|
1942
|
+
name: n.name,
|
|
1943
|
+
expose: r
|
|
1944
|
+
};
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
async loadRemote(e, t) {
|
|
1948
|
+
let { host: n } = this;
|
|
1949
|
+
try {
|
|
1950
|
+
let { loadFactory: r = !0 } = t || { loadFactory: !0 }, { module: i, moduleOptions: a, remoteMatchInfo: o } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: s, remote: c, expose: l, id: u, remoteSnapshot: d } = o, f = await i.get(u, l, t, d), p = await this.hooks.lifecycle.onLoad.emit({
|
|
1951
|
+
id: u,
|
|
1952
|
+
pkgNameOrAlias: s,
|
|
1953
|
+
expose: l,
|
|
1954
|
+
exposeModule: r ? f : void 0,
|
|
1955
|
+
exposeModuleFactory: r ? void 0 : f,
|
|
1956
|
+
remote: c,
|
|
1957
|
+
options: a,
|
|
1958
|
+
moduleInstance: i,
|
|
1959
|
+
origin: n
|
|
1960
|
+
});
|
|
1961
|
+
return this.setIdToRemoteMap(e, o), typeof p == "function" ? p : f;
|
|
1962
|
+
} catch (r) {
|
|
1963
|
+
let { from: i = "runtime" } = t || { from: "runtime" }, a = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
1964
|
+
id: e,
|
|
1965
|
+
error: r,
|
|
1966
|
+
from: i,
|
|
1967
|
+
lifecycle: "onLoad",
|
|
1968
|
+
origin: n
|
|
1969
|
+
});
|
|
1970
|
+
if (!a) throw r;
|
|
1971
|
+
return a;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
async preloadRemote(e) {
|
|
1975
|
+
let { host: t } = this;
|
|
1976
|
+
await this.hooks.lifecycle.beforePreloadRemote.emit({
|
|
1977
|
+
preloadOps: e,
|
|
1978
|
+
options: t.options,
|
|
1979
|
+
origin: t
|
|
1980
|
+
});
|
|
1981
|
+
let n = fn(t.options.remotes, e);
|
|
1982
|
+
await Promise.all(n.map(async (e) => {
|
|
1983
|
+
let { remote: n } = e, r = q(n), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: n }), o = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1984
|
+
origin: t,
|
|
1985
|
+
preloadOptions: e,
|
|
1986
|
+
remote: n,
|
|
1987
|
+
remoteInfo: r,
|
|
1988
|
+
globalSnapshot: i,
|
|
1989
|
+
remoteSnapshot: a
|
|
1990
|
+
});
|
|
1991
|
+
o && mn(r, t, o);
|
|
1992
|
+
}));
|
|
1993
|
+
}
|
|
1994
|
+
registerRemotes(e, t) {
|
|
1995
|
+
let { host: n } = this;
|
|
1996
|
+
e.forEach((e) => {
|
|
1997
|
+
this.registerRemote(e, n.options.remotes, { force: t?.force });
|
|
1998
|
+
});
|
|
1999
|
+
}
|
|
2000
|
+
async getRemoteModuleAndOptions(e) {
|
|
2001
|
+
let { host: t } = this, { id: n } = e, r;
|
|
2002
|
+
try {
|
|
2003
|
+
r = await this.hooks.lifecycle.beforeRequest.emit({
|
|
2004
|
+
id: n,
|
|
2005
|
+
options: t.options,
|
|
2006
|
+
origin: t
|
|
2007
|
+
});
|
|
2008
|
+
} catch (e) {
|
|
2009
|
+
if (r = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2010
|
+
id: n,
|
|
2011
|
+
options: t.options,
|
|
2012
|
+
origin: t,
|
|
2013
|
+
from: "runtime",
|
|
2014
|
+
error: e,
|
|
2015
|
+
lifecycle: "beforeRequest"
|
|
2016
|
+
}), !r) throw e;
|
|
2017
|
+
}
|
|
2018
|
+
let { id: i } = r, a = Pt(t.options.remotes, i);
|
|
2019
|
+
a || y(zt, K, {
|
|
2020
|
+
hostName: t.options.name,
|
|
2021
|
+
requestId: i
|
|
2022
|
+
}, void 0, J(t.options));
|
|
2023
|
+
let { remote: o } = a, s = q(o), c = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
|
|
2024
|
+
id: i,
|
|
2025
|
+
...a,
|
|
2026
|
+
options: t.options,
|
|
2027
|
+
origin: t,
|
|
2028
|
+
remoteInfo: s
|
|
2029
|
+
}), { remote: l, expose: u } = c;
|
|
2030
|
+
v(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);
|
|
2031
|
+
let d = t.moduleCache.get(l.name), f = {
|
|
2032
|
+
host: t,
|
|
2033
|
+
remoteInfo: s
|
|
2034
|
+
};
|
|
2035
|
+
return d || (d = new gn(f), t.moduleCache.set(l.name, d)), {
|
|
2036
|
+
module: d,
|
|
2037
|
+
moduleOptions: f,
|
|
2038
|
+
remoteMatchInfo: c
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
registerRemote(e, t, n) {
|
|
2042
|
+
let { host: r } = this, i = () => {
|
|
2043
|
+
if (e.alias) {
|
|
2044
|
+
let n = t.find((t) => e.alias && (t.name.startsWith(e.alias) || t.alias?.startsWith(e.alias)));
|
|
2045
|
+
v(!n, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${n && n.name} name or alias`);
|
|
2046
|
+
}
|
|
2047
|
+
"entry" in e && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope ||= L, e.type ||= wt;
|
|
2048
|
+
};
|
|
2049
|
+
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
2050
|
+
remote: e,
|
|
2051
|
+
origin: r
|
|
2052
|
+
});
|
|
2053
|
+
let a = t.find((t) => t.name === e.name);
|
|
2054
|
+
if (!a) i(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
|
|
2055
|
+
remote: e,
|
|
2056
|
+
origin: r
|
|
2057
|
+
});
|
|
2058
|
+
else {
|
|
2059
|
+
let o = [`The remote "${e.name}" is already registered.`, "Please note that overriding it may cause unexpected errors."];
|
|
2060
|
+
n?.force && (this.removeRemote(a), i(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
|
|
2061
|
+
remote: e,
|
|
2062
|
+
origin: r
|
|
2063
|
+
}), d(o.join(" ")));
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
removeRemote(e) {
|
|
2067
|
+
try {
|
|
2068
|
+
let { host: t } = this, { name: n } = e, r = t.options.remotes.findIndex((e) => e.name === n);
|
|
2069
|
+
r !== -1 && t.options.remotes.splice(r, 1);
|
|
2070
|
+
let i = t.moduleCache.get(e.name);
|
|
2071
|
+
if (i) {
|
|
2072
|
+
let n = i.remoteInfo, r = n.entryGlobalName;
|
|
2073
|
+
x[r] && (Object.getOwnPropertyDescriptor(x, r)?.configurable ? delete x[r] : x[r] = void 0);
|
|
2074
|
+
let a = on(i.remoteInfo);
|
|
2075
|
+
E[a] && delete E[a], t.snapshotHandler.manifestCache.delete(n.entry);
|
|
2076
|
+
let o = n.buildVersion ? l(n.name, n.buildVersion) : n.name, s = x.__FEDERATION__.__INSTANCES__.findIndex((e) => n.buildVersion ? e.options.id === o : e.name === o);
|
|
2077
|
+
if (s !== -1) {
|
|
2078
|
+
let e = x.__FEDERATION__.__INSTANCES__[s];
|
|
2079
|
+
o = e.options.id || o;
|
|
2080
|
+
let t = Mt(), r = !0, i = [];
|
|
2081
|
+
Object.keys(t).forEach((e) => {
|
|
2082
|
+
let a = t[e];
|
|
2083
|
+
a && Object.keys(a).forEach((t) => {
|
|
2084
|
+
let o = a[t];
|
|
2085
|
+
o && Object.keys(o).forEach((a) => {
|
|
2086
|
+
let s = o[a];
|
|
2087
|
+
s && Object.keys(s).forEach((o) => {
|
|
2088
|
+
let c = s[o];
|
|
2089
|
+
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([
|
|
2090
|
+
e,
|
|
2091
|
+
t,
|
|
2092
|
+
a,
|
|
2093
|
+
o
|
|
2094
|
+
])) : i.push([
|
|
2095
|
+
e,
|
|
2096
|
+
t,
|
|
2097
|
+
a,
|
|
2098
|
+
o
|
|
2099
|
+
]));
|
|
2100
|
+
});
|
|
2101
|
+
});
|
|
2102
|
+
});
|
|
2103
|
+
}), r && (e.shareScopeMap = {}, delete t[o]), i.forEach(([e, n, r, i]) => {
|
|
2104
|
+
delete t[e]?.[n]?.[r]?.[i];
|
|
2105
|
+
}), x.__FEDERATION__.__INSTANCES__.splice(s, 1);
|
|
2106
|
+
}
|
|
2107
|
+
let { hostGlobalSnapshot: c } = Tn(e, t);
|
|
2108
|
+
if (c) {
|
|
2109
|
+
let t = c && "remotesInfo" in c && c.remotesInfo && D(c.remotesInfo, e.name).key;
|
|
2110
|
+
t && (delete c.remotesInfo[t], C.__FEDERATION__.__MANIFEST_LOADING__[t] && delete C.__FEDERATION__.__MANIFEST_LOADING__[t]);
|
|
2111
|
+
}
|
|
2112
|
+
t.moduleCache.delete(e.name);
|
|
2113
|
+
}
|
|
2114
|
+
} catch (e) {
|
|
2115
|
+
he.error(`removeRemote failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
}, kn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0, An = class {
|
|
2119
|
+
constructor(e) {
|
|
2120
|
+
this.hooks = new $({
|
|
2121
|
+
beforeInit: new Z("beforeInit"),
|
|
2122
|
+
init: new Y(),
|
|
2123
|
+
beforeInitContainer: new Q("beforeInitContainer"),
|
|
2124
|
+
initContainer: new Q("initContainer")
|
|
2125
|
+
}), this.version = "2.4.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new $({
|
|
2126
|
+
getModuleInfo: new Y(),
|
|
2127
|
+
createScript: new Y(),
|
|
2128
|
+
createLink: new Y(),
|
|
2129
|
+
fetch: new X(),
|
|
2130
|
+
loadEntryError: new X(),
|
|
2131
|
+
getModuleFactory: new X()
|
|
2132
|
+
}), this.bridgeHook = new $({
|
|
2133
|
+
beforeBridgeRender: new Y(),
|
|
2134
|
+
afterBridgeRender: new Y(),
|
|
2135
|
+
beforeBridgeDestroy: new Y(),
|
|
2136
|
+
afterBridgeDestroy: new Y()
|
|
2137
|
+
});
|
|
2138
|
+
let t = kn ? [yn(), wn()] : [], n = {
|
|
2139
|
+
id: cn(),
|
|
2140
|
+
name: e.name,
|
|
2141
|
+
plugins: t,
|
|
2142
|
+
remotes: [],
|
|
2143
|
+
shared: {},
|
|
2144
|
+
inBrowser: !0
|
|
2145
|
+
};
|
|
2146
|
+
this.name = e.name, this.options = n, this.snapshotHandler = new En(this), this.sharedHandler = new Dn(this), this.remoteHandler = new On(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...n.plugins, ...e.plugins || []]), this.options = this.formatOptions(n, e);
|
|
2147
|
+
}
|
|
2148
|
+
initOptions(e) {
|
|
2149
|
+
e.name && e.name !== this.options.name && y(pe(Gt, K)), this.registerPlugins(e.plugins);
|
|
2150
|
+
let t = this.formatOptions(this.options, e);
|
|
2151
|
+
return this.options = t, t;
|
|
2152
|
+
}
|
|
2153
|
+
async loadShare(e, t) {
|
|
2154
|
+
return this.sharedHandler.loadShare(e, t);
|
|
2155
|
+
}
|
|
2156
|
+
loadShareSync(e, t) {
|
|
2157
|
+
return this.sharedHandler.loadShareSync(e, t);
|
|
2158
|
+
}
|
|
2159
|
+
initializeSharing(e = L, t) {
|
|
2160
|
+
return this.sharedHandler.initializeSharing(e, t);
|
|
2161
|
+
}
|
|
2162
|
+
initRawContainer(e, t, n) {
|
|
2163
|
+
let r = q({
|
|
2164
|
+
name: e,
|
|
2165
|
+
entry: t
|
|
2166
|
+
}), i = new gn({
|
|
2167
|
+
host: this,
|
|
2168
|
+
remoteInfo: r
|
|
2169
|
+
});
|
|
2170
|
+
return i.remoteEntryExports = n, this.moduleCache.set(e, i), i;
|
|
2171
|
+
}
|
|
2172
|
+
async loadRemote(e, t) {
|
|
2173
|
+
return this.remoteHandler.loadRemote(e, t);
|
|
2174
|
+
}
|
|
2175
|
+
async preloadRemote(e) {
|
|
2176
|
+
return this.remoteHandler.preloadRemote(e);
|
|
2177
|
+
}
|
|
2178
|
+
initShareScopeMap(e, t, n = {}) {
|
|
2179
|
+
this.sharedHandler.initShareScopeMap(e, t, n);
|
|
2180
|
+
}
|
|
2181
|
+
formatOptions(e, t) {
|
|
2182
|
+
let { allShareInfos: n } = Et(e, t), { userOptions: r, options: i } = this.hooks.lifecycle.beforeInit.emit({
|
|
2183
|
+
origin: this,
|
|
2184
|
+
userOptions: t,
|
|
2185
|
+
options: e,
|
|
2186
|
+
shareInfo: n
|
|
2187
|
+
}), a = this.remoteHandler.formatAndRegisterRemote(i, r), { allShareInfos: o } = this.sharedHandler.registerShared(i, r), s = [...i.plugins];
|
|
2188
|
+
r.plugins && r.plugins.forEach((e) => {
|
|
2189
|
+
s.includes(e) || s.push(e);
|
|
2190
|
+
});
|
|
2191
|
+
let c = {
|
|
2192
|
+
...e,
|
|
2193
|
+
...t,
|
|
2194
|
+
plugins: s,
|
|
2195
|
+
remotes: a,
|
|
2196
|
+
shared: o,
|
|
2197
|
+
id: r.id || e.id
|
|
2198
|
+
};
|
|
2199
|
+
return this.hooks.lifecycle.init.emit({
|
|
2200
|
+
origin: this,
|
|
2201
|
+
options: c
|
|
2202
|
+
}), c;
|
|
2203
|
+
}
|
|
2204
|
+
registerPlugins(e) {
|
|
2205
|
+
let t = ln(e, this);
|
|
2206
|
+
this.options.plugins = this.options.plugins.reduce((e, t) => (t && e && !e.find((e) => e.name === t.name) && e.push(t), e), t || []);
|
|
2207
|
+
}
|
|
2208
|
+
registerRemotes(e, t) {
|
|
2209
|
+
return this.remoteHandler.registerRemotes(e, t);
|
|
2210
|
+
}
|
|
2211
|
+
registerShared(e) {
|
|
2212
|
+
this.sharedHandler.registerShared(this.options, {
|
|
2213
|
+
...this.options,
|
|
2214
|
+
shared: e
|
|
2215
|
+
});
|
|
2216
|
+
}
|
|
2217
|
+
};
|
|
2218
|
+
//#endregion
|
|
2219
|
+
//#region ../../node_modules/@module-federation/runtime/dist/index.js
|
|
2220
|
+
function jn(e) {
|
|
2221
|
+
let t = new ((Oe()) || An)({
|
|
2222
|
+
id: `${e.name}@${e.version || Date.now()}`,
|
|
2223
|
+
...e
|
|
2224
|
+
});
|
|
2225
|
+
return De(t), t;
|
|
2226
|
+
}
|
|
2227
|
+
ke(An);
|
|
2228
|
+
//#endregion
|
|
2229
|
+
export { jn as t };
|