@linagora/linid-im-front-corelib 0.0.3 → 0.0.5
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/.github/workflows/pull-request.yml +25 -0
- package/CHANGELOG.md +9 -0
- package/CONTRIBUTING.md +7 -2
- package/dist/core-lib.es.js +340 -345
- package/dist/core-lib.umd.js +1 -1
- package/dist/package.json +10 -3
- package/dist/types/src/lifecycle/skeleton.d.ts +6 -12
- package/dist/types/src/types/moduleLifecycle.d.ts +6 -12
- package/docs/module-lifecycle.md +44 -201
- package/eslint.config.js +2 -1
- package/package.json +10 -3
- package/src/lifecycle/skeleton.ts +7 -14
- package/src/types/moduleLifecycle.ts +6 -15
- package/tests/unit/components/LinidZoneRenderer.spec.js +135 -0
- package/tests/unit/lifecycle/skeleton.spec.js +138 -0
- package/tests/unit/services/federationService.spec.js +146 -0
- package/tests/unit/stores/linidZoneStore.spec.js +94 -0
- package/tsconfig.json +11 -27
- package/tsconfig.lib.json +20 -0
- package/tsconfig.node.json +9 -0
- package/tsconfig.spec.json +16 -0
- package/vite.config.ts +11 -16
- package/vitest.config.ts +19 -0
- package/dist/types/vite.config.d.ts +0 -2
package/dist/core-lib.es.js
CHANGED
|
@@ -54,8 +54,8 @@ function requireIndex_cjs$3() {
|
|
|
54
54
|
}
|
|
55
55
|
const getProcessEnv = function() {
|
|
56
56
|
return typeof process < "u" && process.env ? process.env : {};
|
|
57
|
-
}, LOG_CATEGORY = "[ Federation Runtime ]", parseEntry = (t,
|
|
58
|
-
const u = t.split(h), d = getProcessEnv().NODE_ENV === "development" &&
|
|
57
|
+
}, LOG_CATEGORY = "[ Federation Runtime ]", parseEntry = (t, i, h = SEPARATOR) => {
|
|
58
|
+
const u = t.split(h), d = getProcessEnv().NODE_ENV === "development" && i, E = "*", _ = (y) => y.startsWith("http") || y.includes(MANIFEST_EXT);
|
|
59
59
|
if (u.length >= 2) {
|
|
60
60
|
let [y, ...R] = u;
|
|
61
61
|
t.startsWith(h) && (y = u.slice(0, 2).join(h), R = [
|
|
@@ -81,38 +81,38 @@ function requireIndex_cjs$3() {
|
|
|
81
81
|
} else
|
|
82
82
|
throw `Invalid entry value: ${t}`;
|
|
83
83
|
}, composeKeyWithSeparator = function(...t) {
|
|
84
|
-
return t.length ? t.reduce((
|
|
85
|
-
}, encodeName = function(t,
|
|
84
|
+
return t.length ? t.reduce((i, h) => h ? i ? `${i}${SEPARATOR}${h}` : h : i, "") : "";
|
|
85
|
+
}, encodeName = function(t, i = "", h = !1) {
|
|
86
86
|
try {
|
|
87
87
|
const u = h ? ".js" : "";
|
|
88
|
-
return `${
|
|
88
|
+
return `${i}${t.replace(new RegExp(`${NameTransformSymbol.AT}`, "g"), NameTransformMap[NameTransformSymbol.AT]).replace(new RegExp(`${NameTransformSymbol.HYPHEN}`, "g"), NameTransformMap[NameTransformSymbol.HYPHEN]).replace(new RegExp(`${NameTransformSymbol.SLASH}`, "g"), NameTransformMap[NameTransformSymbol.SLASH])}${u}`;
|
|
89
89
|
} catch (u) {
|
|
90
90
|
throw u;
|
|
91
91
|
}
|
|
92
|
-
}, decodeName = function(t,
|
|
92
|
+
}, decodeName = function(t, i, h) {
|
|
93
93
|
try {
|
|
94
94
|
let u = t;
|
|
95
|
-
if (
|
|
96
|
-
if (!u.startsWith(
|
|
95
|
+
if (i) {
|
|
96
|
+
if (!u.startsWith(i))
|
|
97
97
|
return u;
|
|
98
|
-
u = u.replace(new RegExp(
|
|
98
|
+
u = u.replace(new RegExp(i, "g"), "");
|
|
99
99
|
}
|
|
100
100
|
return u = u.replace(new RegExp(`${NameTransformMap[NameTransformSymbol.AT]}`, "g"), EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.AT]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.SLASH]}`, "g"), EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.SLASH]]).replace(new RegExp(`${NameTransformMap[NameTransformSymbol.HYPHEN]}`, "g"), EncodedNameTransformMap[NameTransformMap[NameTransformSymbol.HYPHEN]]), h && (u = u.replace(".js", "")), u;
|
|
101
101
|
} catch (u) {
|
|
102
102
|
throw u;
|
|
103
103
|
}
|
|
104
|
-
}, generateExposeFilename = (t,
|
|
104
|
+
}, generateExposeFilename = (t, i) => {
|
|
105
105
|
if (!t)
|
|
106
106
|
return "";
|
|
107
107
|
let h = t;
|
|
108
|
-
return h === "." && (h = "default_export"), h.startsWith("./") && (h = h.replace("./", "")), encodeName(h, "__federation_expose_",
|
|
109
|
-
}, generateShareFilename = (t,
|
|
108
|
+
return h === "." && (h = "default_export"), h.startsWith("./") && (h = h.replace("./", "")), encodeName(h, "__federation_expose_", i);
|
|
109
|
+
}, generateShareFilename = (t, i) => t ? encodeName(t, "__federation_shared_", i) : "", getResourceUrl = (t, i) => {
|
|
110
110
|
if ("getPublicPath" in t) {
|
|
111
111
|
let h;
|
|
112
|
-
return t.getPublicPath.startsWith("function") ? h = new Function("return " + t.getPublicPath)()() : h = new Function(t.getPublicPath)(), `${h}${
|
|
113
|
-
} else return "publicPath" in t ? !isBrowserEnv() && !isReactNativeEnv() && "ssrPublicPath" in t ? `${t.ssrPublicPath}${
|
|
114
|
-
}, assert = (t,
|
|
115
|
-
t || error(
|
|
112
|
+
return t.getPublicPath.startsWith("function") ? h = new Function("return " + t.getPublicPath)()() : h = new Function(t.getPublicPath)(), `${h}${i}`;
|
|
113
|
+
} else return "publicPath" in t ? !isBrowserEnv() && !isReactNativeEnv() && "ssrPublicPath" in t ? `${t.ssrPublicPath}${i}` : `${t.publicPath}${i}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", t, i), "");
|
|
114
|
+
}, assert = (t, i) => {
|
|
115
|
+
t || error(i);
|
|
116
116
|
}, error = (t) => {
|
|
117
117
|
throw new Error(`${LOG_CATEGORY}: ${t}`);
|
|
118
118
|
}, warn = (t) => {
|
|
@@ -129,9 +129,9 @@ function requireIndex_cjs$3() {
|
|
|
129
129
|
function isRequiredVersion(t) {
|
|
130
130
|
return VERSION_PATTERN_REGEXP.test(t);
|
|
131
131
|
}
|
|
132
|
-
const simpleJoinRemoteEntry = (t,
|
|
132
|
+
const simpleJoinRemoteEntry = (t, i) => {
|
|
133
133
|
if (!t)
|
|
134
|
-
return
|
|
134
|
+
return i;
|
|
135
135
|
const u = ((d) => {
|
|
136
136
|
if (d === ".")
|
|
137
137
|
return "";
|
|
@@ -143,13 +143,13 @@ function requireIndex_cjs$3() {
|
|
|
143
143
|
}
|
|
144
144
|
return d;
|
|
145
145
|
})(t);
|
|
146
|
-
return u ? u.endsWith("/") ? `${u}${
|
|
146
|
+
return u ? u.endsWith("/") ? `${u}${i}` : `${u}/${i}` : i;
|
|
147
147
|
};
|
|
148
148
|
function inferAutoPublicPath(t) {
|
|
149
149
|
return t.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
150
150
|
}
|
|
151
|
-
function generateSnapshotFromManifest(t,
|
|
152
|
-
const { remotes: h = {}, overrides: u = {}, version: d } =
|
|
151
|
+
function generateSnapshotFromManifest(t, i = {}) {
|
|
152
|
+
const { remotes: h = {}, overrides: u = {}, version: d } = i;
|
|
153
153
|
let E;
|
|
154
154
|
const _ = () => "publicPath" in t.metaData ? t.metaData.publicPath === "auto" && d ? inferAutoPublicPath(d) : t.metaData.publicPath : t.metaData.getPublicPath, y = Object.keys(u);
|
|
155
155
|
let R = {};
|
|
@@ -222,11 +222,11 @@ function requireIndex_cjs$3() {
|
|
|
222
222
|
statsFileName: StatsFileName,
|
|
223
223
|
manifestFileName: ManifestFileName
|
|
224
224
|
};
|
|
225
|
-
let
|
|
225
|
+
let i = typeof t == "boolean" ? "" : t.filePath || "", h = typeof t == "boolean" ? "" : t.fileName || "";
|
|
226
226
|
const u = ".json", d = (R) => R.endsWith(u) ? R : `${R}${u}`, E = (R, $) => R.replace(u, `${$}${u}`), _ = h ? d(h) : ManifestFileName, y = h ? E(_, "-stats") : StatsFileName;
|
|
227
227
|
return {
|
|
228
|
-
statsFileName: simpleJoinRemoteEntry(
|
|
229
|
-
manifestFileName: simpleJoinRemoteEntry(
|
|
228
|
+
statsFileName: simpleJoinRemoteEntry(i, y),
|
|
229
|
+
manifestFileName: simpleJoinRemoteEntry(i, _)
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
232
|
const PREFIX = "[ Module Federation ]", DEFAULT_DELEGATE = console, LOGGER_STACK_SKIP_TOKENS = [
|
|
@@ -245,8 +245,8 @@ function requireIndex_cjs$3() {
|
|
|
245
245
|
const t = new Error().stack;
|
|
246
246
|
if (!t)
|
|
247
247
|
return;
|
|
248
|
-
const [, ...
|
|
249
|
-
`), h =
|
|
248
|
+
const [, ...i] = t.split(`
|
|
249
|
+
`), h = i.filter((d) => !LOGGER_STACK_SKIP_TOKENS.some((E) => d.includes(E)));
|
|
250
250
|
return h.length ? `Stack trace:
|
|
251
251
|
${h.slice(0, 5).join(`
|
|
252
252
|
`)}` : void 0;
|
|
@@ -255,18 +255,18 @@ ${h.slice(0, 5).join(`
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
class Logger {
|
|
258
|
-
constructor(
|
|
259
|
-
this.prefix =
|
|
258
|
+
constructor(i, h = DEFAULT_DELEGATE) {
|
|
259
|
+
this.prefix = i, this.delegate = h ?? DEFAULT_DELEGATE;
|
|
260
260
|
}
|
|
261
|
-
setPrefix(
|
|
262
|
-
this.prefix =
|
|
261
|
+
setPrefix(i) {
|
|
262
|
+
this.prefix = i;
|
|
263
263
|
}
|
|
264
|
-
setDelegate(
|
|
265
|
-
this.delegate =
|
|
264
|
+
setDelegate(i) {
|
|
265
|
+
this.delegate = i ?? DEFAULT_DELEGATE;
|
|
266
266
|
}
|
|
267
|
-
emit(
|
|
267
|
+
emit(i, h) {
|
|
268
268
|
const u = this.delegate, E = isDebugMode() ? captureStackTrace() : void 0, _ = E ? [...h, E] : h, y = (() => {
|
|
269
|
-
switch (
|
|
269
|
+
switch (i) {
|
|
270
270
|
case "log":
|
|
271
271
|
return ["log", "info"];
|
|
272
272
|
case "info":
|
|
@@ -295,77 +295,77 @@ ${h.slice(0, 5).join(`
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
log(...
|
|
299
|
-
this.emit("log",
|
|
298
|
+
log(...i) {
|
|
299
|
+
this.emit("log", i);
|
|
300
300
|
}
|
|
301
|
-
warn(...
|
|
302
|
-
this.emit("warn",
|
|
301
|
+
warn(...i) {
|
|
302
|
+
this.emit("warn", i);
|
|
303
303
|
}
|
|
304
|
-
error(...
|
|
305
|
-
this.emit("error",
|
|
304
|
+
error(...i) {
|
|
305
|
+
this.emit("error", i);
|
|
306
306
|
}
|
|
307
|
-
success(...
|
|
308
|
-
this.emit("info",
|
|
307
|
+
success(...i) {
|
|
308
|
+
this.emit("info", i);
|
|
309
309
|
}
|
|
310
|
-
info(...
|
|
311
|
-
this.emit("info",
|
|
310
|
+
info(...i) {
|
|
311
|
+
this.emit("info", i);
|
|
312
312
|
}
|
|
313
|
-
ready(...
|
|
314
|
-
this.emit("info",
|
|
313
|
+
ready(...i) {
|
|
314
|
+
this.emit("info", i);
|
|
315
315
|
}
|
|
316
|
-
debug(...
|
|
317
|
-
isDebugMode() && this.emit("debug",
|
|
316
|
+
debug(...i) {
|
|
317
|
+
isDebugMode() && this.emit("debug", i);
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
function createLogger(t) {
|
|
321
321
|
return new Logger(t);
|
|
322
322
|
}
|
|
323
323
|
function createInfrastructureLogger(t) {
|
|
324
|
-
const
|
|
325
|
-
return Object.defineProperty(
|
|
324
|
+
const i = new Logger(t);
|
|
325
|
+
return Object.defineProperty(i, "__mf_infrastructure_logger__", {
|
|
326
326
|
value: !0,
|
|
327
327
|
enumerable: !1,
|
|
328
328
|
configurable: !1
|
|
329
|
-
}),
|
|
329
|
+
}), i;
|
|
330
330
|
}
|
|
331
|
-
function bindLoggerToCompiler(t,
|
|
332
|
-
if (t.__mf_infrastructure_logger__ &&
|
|
331
|
+
function bindLoggerToCompiler(t, i, h) {
|
|
332
|
+
if (t.__mf_infrastructure_logger__ && i?.getInfrastructureLogger)
|
|
333
333
|
try {
|
|
334
|
-
const u =
|
|
334
|
+
const u = i.getInfrastructureLogger(h);
|
|
335
335
|
u && typeof u == "object" && (typeof u.log == "function" || typeof u.info == "function" || typeof u.warn == "function" || typeof u.error == "function") && t.setDelegate(u);
|
|
336
336
|
} catch {
|
|
337
337
|
t.setDelegate(void 0);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
const logger = createLogger(PREFIX), infrastructureLogger = createInfrastructureLogger(PREFIX);
|
|
341
|
-
async function safeWrapper(t,
|
|
341
|
+
async function safeWrapper(t, i) {
|
|
342
342
|
try {
|
|
343
343
|
return await t();
|
|
344
344
|
} catch (h) {
|
|
345
|
-
!
|
|
345
|
+
!i && warn(h);
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
function isStaticResourcesEqual(t,
|
|
350
|
-
const h = /^(https?:)?\/\//i, u = t.replace(h, "").replace(/\/$/, ""), d =
|
|
349
|
+
function isStaticResourcesEqual(t, i) {
|
|
350
|
+
const h = /^(https?:)?\/\//i, u = t.replace(h, "").replace(/\/$/, ""), d = i.replace(h, "").replace(/\/$/, "");
|
|
351
351
|
return u === d;
|
|
352
352
|
}
|
|
353
353
|
function createScript(t) {
|
|
354
|
-
let
|
|
354
|
+
let i = null, h = !0, u = 2e4, d;
|
|
355
355
|
const E = document.getElementsByTagName("script");
|
|
356
356
|
for (let y = 0; y < E.length; y++) {
|
|
357
357
|
const R = E[y], $ = R.getAttribute("src");
|
|
358
358
|
if ($ && isStaticResourcesEqual($, t.url)) {
|
|
359
|
-
|
|
359
|
+
i = R, h = !1;
|
|
360
360
|
break;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
if (!
|
|
363
|
+
if (!i) {
|
|
364
364
|
const y = t.attrs;
|
|
365
|
-
|
|
365
|
+
i = document.createElement("script"), i.type = y?.type === "module" ? "module" : "text/javascript";
|
|
366
366
|
let R;
|
|
367
|
-
t.createScriptHook && (R = t.createScriptHook(t.url, t.attrs), R instanceof HTMLScriptElement ?
|
|
368
|
-
|
|
367
|
+
t.createScriptHook && (R = t.createScriptHook(t.url, t.attrs), R instanceof HTMLScriptElement ? i = R : typeof R == "object" && ("script" in R && R.script && (i = R.script), "timeout" in R && R.timeout && (u = R.timeout))), i.src || (i.src = t.url), y && !R && Object.keys(y).forEach(($) => {
|
|
368
|
+
i && ($ === "async" || $ === "defer" ? i[$] = y[$] : i.getAttribute($) || i.setAttribute($, y[$]));
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
371
|
const _ = async (y, R) => {
|
|
@@ -373,9 +373,9 @@ ${h.slice(0, 5).join(`
|
|
|
373
373
|
const $ = () => {
|
|
374
374
|
R?.type === "error" ? t?.onErrorCallback && t?.onErrorCallback(R) : t?.cb && t?.cb();
|
|
375
375
|
};
|
|
376
|
-
if (
|
|
376
|
+
if (i && (i.onerror = null, i.onload = null, safeWrapper(() => {
|
|
377
377
|
const { needDeleteScript: w = !0 } = t;
|
|
378
|
-
w &&
|
|
378
|
+
w && i?.parentNode && i.parentNode.removeChild(i);
|
|
379
379
|
}), y && typeof y == "function")) {
|
|
380
380
|
const w = y(R);
|
|
381
381
|
if (w instanceof Promise) {
|
|
@@ -386,45 +386,45 @@ ${h.slice(0, 5).join(`
|
|
|
386
386
|
}
|
|
387
387
|
$();
|
|
388
388
|
};
|
|
389
|
-
return
|
|
389
|
+
return i.onerror = _.bind(null, i.onerror), i.onload = _.bind(null, i.onload), d = setTimeout(() => {
|
|
390
390
|
_(null, new Error(`Remote script "${t.url}" time-outed.`));
|
|
391
|
-
}, u), { script:
|
|
391
|
+
}, u), { script: i, needAttach: h };
|
|
392
392
|
}
|
|
393
393
|
function createLink(t) {
|
|
394
|
-
let
|
|
394
|
+
let i = null, h = !0;
|
|
395
395
|
const u = document.getElementsByTagName("link");
|
|
396
396
|
for (let E = 0; E < u.length; E++) {
|
|
397
397
|
const _ = u[E], y = _.getAttribute("href"), R = _.getAttribute("rel");
|
|
398
398
|
if (y && isStaticResourcesEqual(y, t.url) && R === t.attrs.rel) {
|
|
399
|
-
|
|
399
|
+
i = _, h = !1;
|
|
400
400
|
break;
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
if (!
|
|
404
|
-
|
|
403
|
+
if (!i) {
|
|
404
|
+
i = document.createElement("link"), i.setAttribute("href", t.url);
|
|
405
405
|
let E;
|
|
406
406
|
const _ = t.attrs;
|
|
407
|
-
t.createLinkHook && (E = t.createLinkHook(t.url, _), E instanceof HTMLLinkElement && (
|
|
408
|
-
|
|
407
|
+
t.createLinkHook && (E = t.createLinkHook(t.url, _), E instanceof HTMLLinkElement && (i = E)), _ && !E && Object.keys(_).forEach((y) => {
|
|
408
|
+
i && !i.getAttribute(y) && i.setAttribute(y, _[y]);
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
const d = (E, _) => {
|
|
412
412
|
const y = () => {
|
|
413
413
|
_?.type === "error" ? t?.onErrorCallback && t?.onErrorCallback(_) : t?.cb && t?.cb();
|
|
414
414
|
};
|
|
415
|
-
if (
|
|
415
|
+
if (i && (i.onerror = null, i.onload = null, safeWrapper(() => {
|
|
416
416
|
const { needDeleteLink: R = !0 } = t;
|
|
417
|
-
R &&
|
|
417
|
+
R && i?.parentNode && i.parentNode.removeChild(i);
|
|
418
418
|
}), E)) {
|
|
419
419
|
const R = E(_);
|
|
420
420
|
return y(), R;
|
|
421
421
|
}
|
|
422
422
|
y();
|
|
423
423
|
};
|
|
424
|
-
return
|
|
424
|
+
return i.onerror = d.bind(null, i.onerror), i.onload = d.bind(null, i.onload), { link: i, needAttach: h };
|
|
425
425
|
}
|
|
426
|
-
function loadScript(t,
|
|
427
|
-
const { attrs: h = {}, createScriptHook: u } =
|
|
426
|
+
function loadScript(t, i) {
|
|
427
|
+
const { attrs: h = {}, createScriptHook: u } = i;
|
|
428
428
|
return new Promise((d, E) => {
|
|
429
429
|
const { script: _, needAttach: y } = createScript({
|
|
430
430
|
url: t,
|
|
@@ -454,9 +454,9 @@ ${h.slice(0, 5).join(`
|
|
|
454
454
|
const loadNodeFetch = async () => {
|
|
455
455
|
const t = await importNodeModule("node-fetch");
|
|
456
456
|
return t.default || t;
|
|
457
|
-
}, lazyLoaderHookFetch = async (t,
|
|
458
|
-
const d = await ((E, _) => h.lifecycle.fetch.emit(E, _))(t,
|
|
459
|
-
return !d || !(d instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(t,
|
|
457
|
+
}, lazyLoaderHookFetch = async (t, i, h) => {
|
|
458
|
+
const d = await ((E, _) => h.lifecycle.fetch.emit(E, _))(t, i || {});
|
|
459
|
+
return !d || !(d instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(t, i || {}) : d;
|
|
460
460
|
}, createScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (url, cb, attrs, loaderHook) => {
|
|
461
461
|
if (loaderHook?.createScriptHook) {
|
|
462
462
|
const t = loaderHook.createScriptHook(url);
|
|
@@ -469,7 +469,7 @@ ${h.slice(0, 5).join(`
|
|
|
469
469
|
console.error("Error constructing URL:", t), cb(new Error(`Invalid URL: ${t}`));
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
472
|
-
const getFetch = async () => loaderHook?.fetch ? (t,
|
|
472
|
+
const getFetch = async () => loaderHook?.fetch ? (t, i) => lazyLoaderHookFetch(t, i, loaderHook) : typeof fetch > "u" ? loadNodeFetch() : fetch, handleScriptFetch = async (f, urlObj) => {
|
|
473
473
|
try {
|
|
474
474
|
const res = await f(urlObj.href), data = await res.text(), [path, vm] = await Promise.all([
|
|
475
475
|
importNodeModule("path"),
|
|
@@ -499,55 +499,55 @@ ${h.slice(0, 5).join(`
|
|
|
499
499
|
return loadModule(urlObj.href, {
|
|
500
500
|
fetch: t,
|
|
501
501
|
vm: await importNodeModule("vm")
|
|
502
|
-
}).then(async (
|
|
503
|
-
await
|
|
504
|
-
}).catch((
|
|
505
|
-
cb(
|
|
502
|
+
}).then(async (i) => {
|
|
503
|
+
await i.evaluate(), cb(void 0, i.namespace);
|
|
504
|
+
}).catch((i) => {
|
|
505
|
+
cb(i instanceof Error ? i : new Error(`Script execution error: ${i}`));
|
|
506
506
|
});
|
|
507
507
|
handleScriptFetch(t, urlObj);
|
|
508
508
|
}).catch((t) => {
|
|
509
509
|
cb(t);
|
|
510
510
|
});
|
|
511
|
-
} : (t,
|
|
512
|
-
|
|
513
|
-
}, loadScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (t,
|
|
511
|
+
} : (t, i, h, u) => {
|
|
512
|
+
i(new Error("createScriptNode is disabled in non-Node.js environment"));
|
|
513
|
+
}, loadScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (t, i) => new Promise((h, u) => {
|
|
514
514
|
createScriptNode(t, (d, E) => {
|
|
515
515
|
if (d)
|
|
516
516
|
u(d);
|
|
517
517
|
else {
|
|
518
|
-
const _ =
|
|
518
|
+
const _ = i?.attrs?.globalName || `__FEDERATION_${i?.attrs?.name}:custom__`, y = globalThis[_] = E;
|
|
519
519
|
h(y);
|
|
520
520
|
}
|
|
521
|
-
},
|
|
522
|
-
}) : (t,
|
|
521
|
+
}, i.attrs, i.loaderHook);
|
|
522
|
+
}) : (t, i) => {
|
|
523
523
|
throw new Error("loadScriptNode is disabled in non-Node.js environment");
|
|
524
524
|
}, esmModuleCache = /* @__PURE__ */ new Map();
|
|
525
|
-
async function loadModule(t,
|
|
525
|
+
async function loadModule(t, i) {
|
|
526
526
|
if (esmModuleCache.has(t))
|
|
527
527
|
return esmModuleCache.get(t);
|
|
528
|
-
const { fetch: h, vm: u } =
|
|
528
|
+
const { fetch: h, vm: u } = i, E = await (await h(t)).text(), _ = new u.SourceTextModule(E, {
|
|
529
529
|
// @ts-ignore
|
|
530
530
|
importModuleDynamically: async (y, R) => {
|
|
531
531
|
const $ = new URL(y, t).href;
|
|
532
|
-
return loadModule($,
|
|
532
|
+
return loadModule($, i);
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
return esmModuleCache.set(t, _), await _.link(async (y) => {
|
|
536
536
|
const R = new URL(y, t).href;
|
|
537
|
-
return await loadModule(R,
|
|
537
|
+
return await loadModule(R, i);
|
|
538
538
|
}), _;
|
|
539
539
|
}
|
|
540
|
-
function normalizeOptions(t,
|
|
540
|
+
function normalizeOptions(t, i, h) {
|
|
541
541
|
return function(u) {
|
|
542
542
|
if (u === !1)
|
|
543
543
|
return !1;
|
|
544
544
|
if (typeof u > "u")
|
|
545
|
-
return t ?
|
|
545
|
+
return t ? i : !1;
|
|
546
546
|
if (u === !0)
|
|
547
|
-
return
|
|
547
|
+
return i;
|
|
548
548
|
if (u && typeof u == "object")
|
|
549
549
|
return {
|
|
550
|
-
...
|
|
550
|
+
...i,
|
|
551
551
|
...u
|
|
552
552
|
};
|
|
553
553
|
throw new Error(`Unexpected type for \`${h}\`, expect boolean/undefined/object, got: ${typeof u}`);
|
|
@@ -560,14 +560,14 @@ var index_cjs = {}, hasRequiredIndex_cjs$2;
|
|
|
560
560
|
function requireIndex_cjs$2() {
|
|
561
561
|
if (hasRequiredIndex_cjs$2) return index_cjs;
|
|
562
562
|
hasRequiredIndex_cjs$2 = 1;
|
|
563
|
-
const t = "RUNTIME-001",
|
|
563
|
+
const t = "RUNTIME-001", i = "RUNTIME-002", h = "RUNTIME-003", u = "RUNTIME-004", d = "RUNTIME-005", E = "RUNTIME-006", _ = "RUNTIME-007", y = "RUNTIME-008", R = "RUNTIME-009", $ = "TYPE-001", w = "BUILD-001", C = "BUILD-002", H = (D) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${D.split("-")[0].toLowerCase()}/${D}`, B = (D, P, F, V) => {
|
|
564
564
|
const ee = [`${[P[D]]} #${D}`];
|
|
565
565
|
return F && ee.push(`args: ${JSON.stringify(F)}`), ee.push(H(D)), V && ee.push(`Original Error Message:
|
|
566
566
|
${V}`), ee.join(`
|
|
567
567
|
`);
|
|
568
568
|
}, x = {
|
|
569
569
|
[t]: "Failed to get remoteEntry exports.",
|
|
570
|
-
[
|
|
570
|
+
[i]: 'The remote entry interface does not contain "init"',
|
|
571
571
|
[h]: "Failed to get manifest.",
|
|
572
572
|
[u]: "Failed to locate remote.",
|
|
573
573
|
[d]: "Invalid loadShareSync function call from bundler runtime",
|
|
@@ -585,13 +585,13 @@ function requireIndex_cjs$2() {
|
|
|
585
585
|
...U,
|
|
586
586
|
...Q
|
|
587
587
|
};
|
|
588
|
-
return index_cjs.BUILD_001 = w, index_cjs.BUILD_002 = C, index_cjs.RUNTIME_001 = t, index_cjs.RUNTIME_002 =
|
|
588
|
+
return index_cjs.BUILD_001 = w, index_cjs.BUILD_002 = C, index_cjs.RUNTIME_001 = t, index_cjs.RUNTIME_002 = i, index_cjs.RUNTIME_003 = h, index_cjs.RUNTIME_004 = u, index_cjs.RUNTIME_005 = d, index_cjs.RUNTIME_006 = E, index_cjs.RUNTIME_007 = _, index_cjs.RUNTIME_008 = y, index_cjs.RUNTIME_009 = R, index_cjs.TYPE_001 = $, index_cjs.buildDescMap = Q, index_cjs.errorDescMap = J, index_cjs.getShortErrorMsg = B, index_cjs.runtimeDescMap = x, index_cjs.typeDescMap = U, index_cjs;
|
|
589
589
|
}
|
|
590
590
|
var hasRequiredIndex_cjs$1;
|
|
591
591
|
function requireIndex_cjs$1() {
|
|
592
592
|
if (hasRequiredIndex_cjs$1) return index_cjs$2;
|
|
593
593
|
hasRequiredIndex_cjs$1 = 1;
|
|
594
|
-
var t = /* @__PURE__ */ requireIndex_cjs$3(),
|
|
594
|
+
var t = /* @__PURE__ */ requireIndex_cjs$3(), i = /* @__PURE__ */ requireIndex_cjs$2();
|
|
595
595
|
const h = "[ Federation Runtime ]", u = t.createLogger(h);
|
|
596
596
|
function d(r, e) {
|
|
597
597
|
r || E(e);
|
|
@@ -630,8 +630,8 @@ function requireIndex_cjs$1() {
|
|
|
630
630
|
return B.call(r) === "[object Object]";
|
|
631
631
|
}
|
|
632
632
|
function U(r, e) {
|
|
633
|
-
const n = /^(https?:)?\/\//i, o = r.replace(n, "").replace(/\/$/, ""),
|
|
634
|
-
return o ===
|
|
633
|
+
const n = /^(https?:)?\/\//i, o = r.replace(n, "").replace(/\/$/, ""), s = e.replace(n, "").replace(/\/$/, "");
|
|
634
|
+
return o === s;
|
|
635
635
|
}
|
|
636
636
|
function Q(r) {
|
|
637
637
|
return Array.isArray(r) ? r : [r];
|
|
@@ -708,8 +708,8 @@ function requireIndex_cjs$1() {
|
|
|
708
708
|
};
|
|
709
709
|
{
|
|
710
710
|
const o = Object.keys(r);
|
|
711
|
-
for (const
|
|
712
|
-
const [c, a] =
|
|
711
|
+
for (const s of o) {
|
|
712
|
+
const [c, a] = s.split(":"), l = `${c}:${e}`, p = r[l];
|
|
713
713
|
if (p)
|
|
714
714
|
return {
|
|
715
715
|
value: p,
|
|
@@ -729,8 +729,8 @@ function requireIndex_cjs$1() {
|
|
|
729
729
|
if (o && !o.version && "version" in r && r.version && (o.version = r.version), o)
|
|
730
730
|
return o;
|
|
731
731
|
if ("version" in r && r.version) {
|
|
732
|
-
const { version:
|
|
733
|
-
if (l?.version ===
|
|
732
|
+
const { version: s, ...c } = r, a = R(c), l = Z(F.__FEDERATION__.moduleInfo, a).value;
|
|
733
|
+
if (l?.version === s)
|
|
734
734
|
return l;
|
|
735
735
|
}
|
|
736
736
|
}, he = (r) => Ie(r, F.__FEDERATION__.moduleInfo), le = (r, e) => {
|
|
@@ -768,11 +768,11 @@ function requireIndex_cjs$1() {
|
|
|
768
768
|
return r.match(ie(Nt));
|
|
769
769
|
}
|
|
770
770
|
function rt(r, e, n, o) {
|
|
771
|
-
const
|
|
772
|
-
return o ? `${
|
|
771
|
+
const s = `${r}.${e}.${n}`;
|
|
772
|
+
return o ? `${s}-${o}` : s;
|
|
773
773
|
}
|
|
774
774
|
function $t(r) {
|
|
775
|
-
return r.replace(ie(ht), (e, n, o,
|
|
775
|
+
return r.replace(ie(ht), (e, n, o, s, c, a, l, p, m, b, S, g) => (X(o) ? n = "" : X(s) ? n = `>=${o}.0.0` : X(c) ? n = `>=${o}.${s}.0` : n = `>=${n}`, X(m) ? p = "" : X(b) ? p = `<${Number(m) + 1}.0.0-0` : X(S) ? p = `<${m}.${Number(b) + 1}.0-0` : g ? p = `<=${m}.${b}.${S}-${g}` : p = `<=${p}`, `${n} ${p}`.trim()));
|
|
776
776
|
}
|
|
777
777
|
function Tt(r) {
|
|
778
778
|
return r.replace(ie(mt), "$1$2$3");
|
|
@@ -784,15 +784,15 @@ function requireIndex_cjs$1() {
|
|
|
784
784
|
return r.replace(ie(Et), "$1^");
|
|
785
785
|
}
|
|
786
786
|
function Mt(r) {
|
|
787
|
-
return r.trim().split(/\s+/).map((e) => e.replace(ie(gt), (n, o,
|
|
787
|
+
return r.trim().split(/\s+/).map((e) => e.replace(ie(gt), (n, o, s, c, a) => X(o) ? "" : X(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : X(c) ? o === "0" ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.0 <${Number(o) + 1}.0.0-0` : a ? o === "0" ? s === "0" ? `>=${o}.${s}.${c}-${a} <${o}.${s}.${Number(c) + 1}-0` : `>=${o}.${s}.${c}-${a} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${c}-${a} <${Number(o) + 1}.0.0-0` : o === "0" ? s === "0" ? `>=${o}.${s}.${c} <${o}.${s}.${Number(c) + 1}-0` : `>=${o}.${s}.${c} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${c} <${Number(o) + 1}.0.0-0`)).join(" ");
|
|
788
788
|
}
|
|
789
789
|
function Pt(r) {
|
|
790
|
-
return r.trim().split(/\s+/).map((e) => e.replace(ie(St), (n, o,
|
|
790
|
+
return r.trim().split(/\s+/).map((e) => e.replace(ie(St), (n, o, s, c, a) => X(o) ? "" : X(s) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : X(c) ? `>=${o}.${s}.0 <${o}.${Number(s) + 1}.0-0` : a ? `>=${o}.${s}.${c}-${a} <${o}.${Number(s) + 1}.0-0` : `>=${o}.${s}.${c} <${o}.${Number(s) + 1}.0-0`)).join(" ");
|
|
791
791
|
}
|
|
792
792
|
function wt(r) {
|
|
793
|
-
return r.split(/\s+/).map((e) => e.trim().replace(ie(Rt), (n, o,
|
|
794
|
-
const p = X(
|
|
795
|
-
return o === "=" && b && (o = ""), l = "", p ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && b ? (m && (c = 0), a = 0, o === ">" ? (o = ">=", m ? (
|
|
793
|
+
return r.split(/\s+/).map((e) => e.trim().replace(ie(Rt), (n, o, s, c, a, l) => {
|
|
794
|
+
const p = X(s), m = p || X(c), b = m || X(a);
|
|
795
|
+
return o === "=" && b && (o = ""), l = "", p ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && b ? (m && (c = 0), a = 0, o === ">" ? (o = ">=", m ? (s = Number(s) + 1, c = 0, a = 0) : (c = Number(c) + 1, a = 0)) : o === "<=" && (o = "<", m ? s = Number(s) + 1 : c = Number(c) + 1), o === "<" && (l = "-0"), `${o + s}.${c}.${a}${l}`) : m ? `>=${s}.0.0${l} <${Number(s) + 1}.0.0-0` : b ? `>=${s}.${c}.0${l} <${s}.${Number(c) + 1}.0-0` : n;
|
|
796
796
|
})).join(" ");
|
|
797
797
|
}
|
|
798
798
|
function xt(r) {
|
|
@@ -812,8 +812,8 @@ function requireIndex_cjs$1() {
|
|
|
812
812
|
return -1;
|
|
813
813
|
if (n === void 0 && o === void 0)
|
|
814
814
|
return 0;
|
|
815
|
-
for (let
|
|
816
|
-
const a = n[
|
|
815
|
+
for (let s = 0, c = n.length; s <= c; s++) {
|
|
816
|
+
const a = n[s], l = o[s];
|
|
817
817
|
if (a !== l)
|
|
818
818
|
return a === void 0 && l === void 0 ? 0 : a ? l ? Oe(a, l) : -1 : 1;
|
|
819
819
|
}
|
|
@@ -888,11 +888,11 @@ function requireIndex_cjs$1() {
|
|
|
888
888
|
const n = tt(r);
|
|
889
889
|
if (!n)
|
|
890
890
|
return !1;
|
|
891
|
-
const [, o, ,
|
|
891
|
+
const [, o, , s, c, a, l] = n, p = {
|
|
892
892
|
operator: o,
|
|
893
|
-
version: rt(
|
|
893
|
+
version: rt(s, c, a, l),
|
|
894
894
|
// exclude build atom
|
|
895
|
-
major:
|
|
895
|
+
major: s,
|
|
896
896
|
minor: c,
|
|
897
897
|
patch: a,
|
|
898
898
|
preRelease: l?.split(".")
|
|
@@ -941,8 +941,8 @@ function requireIndex_cjs$1() {
|
|
|
941
941
|
return !1;
|
|
942
942
|
}
|
|
943
943
|
function kt(r, e, n, o) {
|
|
944
|
-
let
|
|
945
|
-
return "get" in r ?
|
|
944
|
+
let s;
|
|
945
|
+
return "get" in r ? s = r.get : "lib" in r ? s = () => Promise.resolve(r.lib) : s = () => Promise.resolve(() => {
|
|
946
946
|
throw new Error(`Can not get shared '${n}'!`);
|
|
947
947
|
}), {
|
|
948
948
|
deps: [],
|
|
@@ -957,7 +957,7 @@ function requireIndex_cjs$1() {
|
|
|
957
957
|
strictVersion: !1,
|
|
958
958
|
...r.shareConfig
|
|
959
959
|
},
|
|
960
|
-
get:
|
|
960
|
+
get: s,
|
|
961
961
|
loaded: r?.loaded || "lib" in r ? !0 : void 0,
|
|
962
962
|
version: r.version ?? "0",
|
|
963
963
|
scope: Array.isArray(r.scope) ? r.scope : [r.scope ?? "default"],
|
|
@@ -965,7 +965,7 @@ function requireIndex_cjs$1() {
|
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
967
|
function nt(r, e) {
|
|
968
|
-
const n = e.shared || {}, o = e.name,
|
|
968
|
+
const n = e.shared || {}, o = e.name, s = Object.keys(n).reduce((a, l) => {
|
|
969
969
|
const p = Q(n[l]);
|
|
970
970
|
return a[l] = a[l] || [], p.forEach((m) => {
|
|
971
971
|
a[l].push(kt(m, o, l, e.shareStrategy));
|
|
@@ -973,11 +973,11 @@ function requireIndex_cjs$1() {
|
|
|
973
973
|
}, {}), c = {
|
|
974
974
|
...r.shared
|
|
975
975
|
};
|
|
976
|
-
return Object.keys(
|
|
977
|
-
c[a] ?
|
|
976
|
+
return Object.keys(s).forEach((a) => {
|
|
977
|
+
c[a] ? s[a].forEach((l) => {
|
|
978
978
|
c[a].find((m) => m.version === l.version) || c[a].push(l);
|
|
979
|
-
}) : c[a] =
|
|
980
|
-
}), { shared: c, shareInfos:
|
|
979
|
+
}) : c[a] = s[a];
|
|
980
|
+
}), { shared: c, shareInfos: s };
|
|
981
981
|
}
|
|
982
982
|
function be(r, e) {
|
|
983
983
|
const n = (o) => {
|
|
@@ -993,23 +993,23 @@ function requireIndex_cjs$1() {
|
|
|
993
993
|
return !!ge(n(r), `<=${n(e)}`);
|
|
994
994
|
}
|
|
995
995
|
const je = (r, e) => {
|
|
996
|
-
const n = e || function(o,
|
|
997
|
-
return be(o,
|
|
996
|
+
const n = e || function(o, s) {
|
|
997
|
+
return be(o, s);
|
|
998
998
|
};
|
|
999
|
-
return Object.keys(r).reduce((o,
|
|
999
|
+
return Object.keys(r).reduce((o, s) => !o || n(o, s) || o === "0" ? s : o, 0);
|
|
1000
1000
|
}, Ae = (r) => !!r.loaded || typeof r.lib == "function", Ct = (r) => !!r.loading;
|
|
1001
1001
|
function Ht(r, e, n) {
|
|
1002
|
-
const o = r[e][n],
|
|
1002
|
+
const o = r[e][n], s = function(c, a) {
|
|
1003
1003
|
return !Ae(o[c]) && be(c, a);
|
|
1004
1004
|
};
|
|
1005
|
-
return je(r[e][n],
|
|
1005
|
+
return je(r[e][n], s);
|
|
1006
1006
|
}
|
|
1007
1007
|
function Ut(r, e, n) {
|
|
1008
|
-
const o = r[e][n],
|
|
1008
|
+
const o = r[e][n], s = function(c, a) {
|
|
1009
1009
|
const l = (p) => Ae(p) || Ct(p);
|
|
1010
1010
|
return l(o[a]) ? l(o[c]) ? !!be(c, a) : !0 : l(o[c]) ? !1 : be(c, a);
|
|
1011
1011
|
};
|
|
1012
|
-
return je(r[e][n],
|
|
1012
|
+
return je(r[e][n], s);
|
|
1013
1013
|
}
|
|
1014
1014
|
function Gt(r) {
|
|
1015
1015
|
return r === "loaded-first" ? Ut : Ht;
|
|
@@ -1017,14 +1017,14 @@ function requireIndex_cjs$1() {
|
|
|
1017
1017
|
function me(r, e, n, o) {
|
|
1018
1018
|
if (!r)
|
|
1019
1019
|
return;
|
|
1020
|
-
const { shareConfig:
|
|
1020
|
+
const { shareConfig: s, scope: c = Ee, strategy: a } = n, l = Array.isArray(c) ? c : [c];
|
|
1021
1021
|
for (const p of l)
|
|
1022
|
-
if (
|
|
1023
|
-
const { requiredVersion: m } =
|
|
1024
|
-
if (
|
|
1022
|
+
if (s && r[p] && r[p][e]) {
|
|
1023
|
+
const { requiredVersion: m } = s, S = Gt(a)(r, p, e), g = () => {
|
|
1024
|
+
if (s.singleton) {
|
|
1025
1025
|
if (typeof m == "string" && !ge(S, m)) {
|
|
1026
1026
|
const j = `Version ${S} from ${S && r[p][e][S].from} of shared singleton module ${e} does not satisfy the requirement of ${n.from} which needs ${m})`;
|
|
1027
|
-
|
|
1027
|
+
s.strictVersion ? E(j) : _(j);
|
|
1028
1028
|
}
|
|
1029
1029
|
return r[p][e][S];
|
|
1030
1030
|
} else {
|
|
@@ -1049,7 +1049,7 @@ function requireIndex_cjs$1() {
|
|
|
1049
1049
|
return V.__FEDERATION__.__SHARE__;
|
|
1050
1050
|
}
|
|
1051
1051
|
function ot(r) {
|
|
1052
|
-
const { pkgName: e, extraOptions: n, shareInfos: o } = r,
|
|
1052
|
+
const { pkgName: e, extraOptions: n, shareInfos: o } = r, s = (a) => {
|
|
1053
1053
|
if (!a)
|
|
1054
1054
|
return;
|
|
1055
1055
|
const l = {};
|
|
@@ -1060,7 +1060,7 @@ function requireIndex_cjs$1() {
|
|
|
1060
1060
|
return !Ae(l[b]) && be(b, S);
|
|
1061
1061
|
});
|
|
1062
1062
|
return l[m];
|
|
1063
|
-
}, c = n?.resolver ??
|
|
1063
|
+
}, c = n?.resolver ?? s;
|
|
1064
1064
|
return Object.assign({}, c(o[e]), n?.customShareInfo);
|
|
1065
1065
|
}
|
|
1066
1066
|
function Vt() {
|
|
@@ -1072,16 +1072,16 @@ function requireIndex_cjs$1() {
|
|
|
1072
1072
|
function Le(r, e) {
|
|
1073
1073
|
for (const n of r) {
|
|
1074
1074
|
const o = e.startsWith(n.name);
|
|
1075
|
-
let
|
|
1075
|
+
let s = e.replace(n.name, "");
|
|
1076
1076
|
if (o) {
|
|
1077
|
-
if (
|
|
1077
|
+
if (s.startsWith("/")) {
|
|
1078
1078
|
const l = n.name;
|
|
1079
|
-
return
|
|
1079
|
+
return s = `.${s}`, {
|
|
1080
1080
|
pkgNameOrAlias: l,
|
|
1081
|
-
expose:
|
|
1081
|
+
expose: s,
|
|
1082
1082
|
remote: n
|
|
1083
1083
|
};
|
|
1084
|
-
} else if (
|
|
1084
|
+
} else if (s === "")
|
|
1085
1085
|
return {
|
|
1086
1086
|
pkgNameOrAlias: n.name,
|
|
1087
1087
|
expose: ".",
|
|
@@ -1121,11 +1121,11 @@ function requireIndex_cjs$1() {
|
|
|
1121
1121
|
e.loaderHook,
|
|
1122
1122
|
e.bridgeHook
|
|
1123
1123
|
];
|
|
1124
|
-
return n.length > 0 && n.forEach((
|
|
1125
|
-
r?.find((c) => c.name !==
|
|
1126
|
-
}), r && r.length > 0 && r.forEach((
|
|
1124
|
+
return n.length > 0 && n.forEach((s) => {
|
|
1125
|
+
r?.find((c) => c.name !== s.name) && r.push(s);
|
|
1126
|
+
}), r && r.length > 0 && r.forEach((s) => {
|
|
1127
1127
|
o.forEach((c) => {
|
|
1128
|
-
c.applyPlugin(
|
|
1128
|
+
c.applyPlugin(s, e);
|
|
1129
1129
|
});
|
|
1130
1130
|
}), r;
|
|
1131
1131
|
}
|
|
@@ -1141,8 +1141,8 @@ function requireIndex_cjs$1() {
|
|
|
1141
1141
|
/* @vite-ignore */
|
|
1142
1142
|
r
|
|
1143
1143
|
).then(n).catch(o);
|
|
1144
|
-
} catch (
|
|
1145
|
-
o(
|
|
1144
|
+
} catch (s) {
|
|
1145
|
+
o(s);
|
|
1146
1146
|
}
|
|
1147
1147
|
});
|
|
1148
1148
|
}
|
|
@@ -1150,24 +1150,24 @@ function requireIndex_cjs$1() {
|
|
|
1150
1150
|
return new Promise((n, o) => {
|
|
1151
1151
|
try {
|
|
1152
1152
|
e ? n(e) : typeof __system_context__ > "u" ? System.import(r).then(n).catch(o) : new Function("callbacks", `System.import("${r}")${st}`)([n, o]);
|
|
1153
|
-
} catch (
|
|
1154
|
-
o(
|
|
1153
|
+
} catch (s) {
|
|
1154
|
+
o(s);
|
|
1155
1155
|
}
|
|
1156
1156
|
});
|
|
1157
1157
|
}
|
|
1158
1158
|
function it(r, e, n) {
|
|
1159
|
-
const { remoteEntryKey: o, entryExports:
|
|
1160
|
-
return d(
|
|
1159
|
+
const { remoteEntryKey: o, entryExports: s } = $e(r, e);
|
|
1160
|
+
return d(s, i.getShortErrorMsg(i.RUNTIME_001, i.runtimeDescMap, {
|
|
1161
1161
|
remoteName: r,
|
|
1162
1162
|
remoteEntryUrl: n,
|
|
1163
1163
|
remoteEntryKey: o
|
|
1164
|
-
})),
|
|
1164
|
+
})), s;
|
|
1165
1165
|
}
|
|
1166
|
-
async function zt({ name: r, globalName: e, entry: n, loaderHook: o, getEntryUrl:
|
|
1166
|
+
async function zt({ name: r, globalName: e, entry: n, loaderHook: o, getEntryUrl: s }) {
|
|
1167
1167
|
const { entryExports: c } = $e(r, e);
|
|
1168
1168
|
if (c)
|
|
1169
1169
|
return c;
|
|
1170
|
-
const a =
|
|
1170
|
+
const a = s ? s(n) : n;
|
|
1171
1171
|
return t.loadScript(a, {
|
|
1172
1172
|
attrs: {},
|
|
1173
1173
|
createScriptHook: (l, p) => {
|
|
@@ -1176,23 +1176,23 @@ function requireIndex_cjs$1() {
|
|
|
1176
1176
|
return m;
|
|
1177
1177
|
}
|
|
1178
1178
|
}).then(() => it(r, e, n)).catch((l) => {
|
|
1179
|
-
throw d(void 0,
|
|
1179
|
+
throw d(void 0, i.getShortErrorMsg(i.RUNTIME_008, i.runtimeDescMap, {
|
|
1180
1180
|
remoteName: r,
|
|
1181
1181
|
resourceUrl: n
|
|
1182
1182
|
})), l;
|
|
1183
1183
|
});
|
|
1184
1184
|
}
|
|
1185
1185
|
async function Xt({ remoteInfo: r, remoteEntryExports: e, loaderHook: n, getEntryUrl: o }) {
|
|
1186
|
-
const { entry:
|
|
1186
|
+
const { entry: s, entryGlobalName: c, name: a, type: l } = r;
|
|
1187
1187
|
switch (l) {
|
|
1188
1188
|
case "esm":
|
|
1189
1189
|
case "module":
|
|
1190
|
-
return Wt({ entry:
|
|
1190
|
+
return Wt({ entry: s, remoteEntryExports: e });
|
|
1191
1191
|
case "system":
|
|
1192
|
-
return Kt({ entry:
|
|
1192
|
+
return Kt({ entry: s, remoteEntryExports: e });
|
|
1193
1193
|
default:
|
|
1194
1194
|
return zt({
|
|
1195
|
-
entry:
|
|
1195
|
+
entry: s,
|
|
1196
1196
|
globalName: c,
|
|
1197
1197
|
name: a,
|
|
1198
1198
|
loaderHook: n,
|
|
@@ -1201,9 +1201,9 @@ function requireIndex_cjs$1() {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
1203
1203
|
async function Yt({ remoteInfo: r, loaderHook: e }) {
|
|
1204
|
-
const { entry: n, entryGlobalName: o, name:
|
|
1204
|
+
const { entry: n, entryGlobalName: o, name: s, type: c } = r, { entryExports: a } = $e(s, o);
|
|
1205
1205
|
return a || t.loadScriptNode(n, {
|
|
1206
|
-
attrs: { name:
|
|
1206
|
+
attrs: { name: s, globalName: o, type: c },
|
|
1207
1207
|
loaderHook: {
|
|
1208
1208
|
createScriptHook: (l, p = {}) => {
|
|
1209
1209
|
const m = e.lifecycle.createScript.emit({ url: l, attrs: p });
|
|
@@ -1211,7 +1211,7 @@ function requireIndex_cjs$1() {
|
|
|
1211
1211
|
return m;
|
|
1212
1212
|
}
|
|
1213
1213
|
}
|
|
1214
|
-
}).then(() => it(
|
|
1214
|
+
}).then(() => it(s, o, n)).catch((l) => {
|
|
1215
1215
|
throw l;
|
|
1216
1216
|
});
|
|
1217
1217
|
}
|
|
@@ -1220,7 +1220,7 @@ function requireIndex_cjs$1() {
|
|
|
1220
1220
|
return t.composeKeyWithSeparator(n, e);
|
|
1221
1221
|
}
|
|
1222
1222
|
async function Se(r) {
|
|
1223
|
-
const { origin: e, remoteEntryExports: n, remoteInfo: o, getEntryUrl:
|
|
1223
|
+
const { origin: e, remoteEntryExports: n, remoteInfo: o, getEntryUrl: s, _inErrorHandling: c = !1 } = r, a = Fe(o);
|
|
1224
1224
|
if (n)
|
|
1225
1225
|
return n;
|
|
1226
1226
|
if (!ce[a]) {
|
|
@@ -1233,10 +1233,10 @@ function requireIndex_cjs$1() {
|
|
|
1233
1233
|
remoteInfo: o,
|
|
1234
1234
|
remoteEntryExports: n,
|
|
1235
1235
|
loaderHook: p,
|
|
1236
|
-
getEntryUrl:
|
|
1236
|
+
getEntryUrl: s
|
|
1237
1237
|
}) : Yt({ remoteInfo: o, loaderHook: p }))).catch(async (m) => {
|
|
1238
1238
|
const b = Fe(o);
|
|
1239
|
-
if (m instanceof Error && m.message.includes(
|
|
1239
|
+
if (m instanceof Error && m.message.includes(i.RUNTIME_008) && !c) {
|
|
1240
1240
|
const g = (M) => Se({ ...M, _inErrorHandling: !0 }), O = await e.loaderHook.lifecycle.loadEntryError.emit({
|
|
1241
1241
|
getRemoteEntry: g,
|
|
1242
1242
|
origin: e,
|
|
@@ -1287,7 +1287,7 @@ function requireIndex_cjs$1() {
|
|
|
1287
1287
|
return r ? r.map((e) => e === "." ? e : e.startsWith("./") ? e.replace("./", "") : e) : [];
|
|
1288
1288
|
}
|
|
1289
1289
|
function ke(r, e, n, o = !0) {
|
|
1290
|
-
const { cssAssets:
|
|
1290
|
+
const { cssAssets: s, jsAssetsWithoutEntry: c, entryAssets: a } = n;
|
|
1291
1291
|
if (e.options.inBrowser) {
|
|
1292
1292
|
if (a.forEach((l) => {
|
|
1293
1293
|
const { moduleInfo: p } = l, m = e.moduleCache.get(r.name);
|
|
@@ -1305,7 +1305,7 @@ function requireIndex_cjs$1() {
|
|
|
1305
1305
|
rel: "preload",
|
|
1306
1306
|
as: "style"
|
|
1307
1307
|
};
|
|
1308
|
-
|
|
1308
|
+
s.forEach((p) => {
|
|
1309
1309
|
const { link: m, needAttach: b } = t.createLink({
|
|
1310
1310
|
url: p,
|
|
1311
1311
|
cb: () => {
|
|
@@ -1327,7 +1327,7 @@ function requireIndex_cjs$1() {
|
|
|
1327
1327
|
rel: "stylesheet",
|
|
1328
1328
|
type: "text/css"
|
|
1329
1329
|
};
|
|
1330
|
-
|
|
1330
|
+
s.forEach((p) => {
|
|
1331
1331
|
const { link: m, needAttach: b } = t.createLink({
|
|
1332
1332
|
url: p,
|
|
1333
1333
|
cb: () => {
|
|
@@ -1440,7 +1440,7 @@ function requireIndex_cjs$1() {
|
|
|
1440
1440
|
${t.safeToString(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
|
|
1441
1441
|
}
|
|
1442
1442
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1443
|
-
async get(e, n, o,
|
|
1443
|
+
async get(e, n, o, s) {
|
|
1444
1444
|
const { loadFactory: c = !0 } = o || { loadFactory: !0 }, a = await this.getEntry();
|
|
1445
1445
|
if (!this.inited) {
|
|
1446
1446
|
const S = this.host.shareScopeMap, g = Array.isArray(this.remoteInfo.shareScope) ? this.remoteInfo.shareScope : [this.remoteInfo.shareScope];
|
|
@@ -1464,7 +1464,7 @@ function requireIndex_cjs$1() {
|
|
|
1464
1464
|
remoteInfo: this.remoteInfo,
|
|
1465
1465
|
origin: this.host
|
|
1466
1466
|
});
|
|
1467
|
-
typeof a?.init > "u" && E(
|
|
1467
|
+
typeof a?.init > "u" && E(i.getShortErrorMsg(i.RUNTIME_002, i.runtimeDescMap, {
|
|
1468
1468
|
hostName: this.host.name,
|
|
1469
1469
|
remoteName: this.remoteInfo.name,
|
|
1470
1470
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
@@ -1472,7 +1472,7 @@ function requireIndex_cjs$1() {
|
|
|
1472
1472
|
})), await a.init(T.shareScope, T.initScope, T.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
|
|
1473
1473
|
...T,
|
|
1474
1474
|
id: e,
|
|
1475
|
-
remoteSnapshot:
|
|
1475
|
+
remoteSnapshot: s,
|
|
1476
1476
|
remoteEntryExports: a
|
|
1477
1477
|
});
|
|
1478
1478
|
}
|
|
@@ -1487,18 +1487,18 @@ function requireIndex_cjs$1() {
|
|
|
1487
1487
|
return c ? await m() : m;
|
|
1488
1488
|
}
|
|
1489
1489
|
wraperFactory(e, n) {
|
|
1490
|
-
function o(
|
|
1491
|
-
|
|
1490
|
+
function o(s, c) {
|
|
1491
|
+
s && typeof s == "object" && Object.isExtensible(s) && !Object.getOwnPropertyDescriptor(s, Symbol.for("mf_module_id")) && Object.defineProperty(s, Symbol.for("mf_module_id"), {
|
|
1492
1492
|
value: c,
|
|
1493
1493
|
enumerable: !1
|
|
1494
1494
|
});
|
|
1495
1495
|
}
|
|
1496
1496
|
return e instanceof Promise ? async () => {
|
|
1497
|
-
const
|
|
1498
|
-
return o(
|
|
1497
|
+
const s = await e();
|
|
1498
|
+
return o(s, n), s;
|
|
1499
1499
|
} : () => {
|
|
1500
|
-
const
|
|
1501
|
-
return o(
|
|
1500
|
+
const s = e();
|
|
1501
|
+
return o(s, n), s;
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
@@ -1511,8 +1511,8 @@ function requireIndex_cjs$1() {
|
|
|
1511
1511
|
}
|
|
1512
1512
|
once(e) {
|
|
1513
1513
|
const n = this;
|
|
1514
|
-
this.on(function o(...
|
|
1515
|
-
return n.remove(o), e.apply(null,
|
|
1514
|
+
this.on(function o(...s) {
|
|
1515
|
+
return n.remove(o), e.apply(null, s);
|
|
1516
1516
|
});
|
|
1517
1517
|
}
|
|
1518
1518
|
emit(...e) {
|
|
@@ -1533,8 +1533,8 @@ function requireIndex_cjs$1() {
|
|
|
1533
1533
|
let n;
|
|
1534
1534
|
const o = Array.from(this.listeners);
|
|
1535
1535
|
if (o.length > 0) {
|
|
1536
|
-
let
|
|
1537
|
-
const c = (a) => a === !1 ? !1 :
|
|
1536
|
+
let s = 0;
|
|
1537
|
+
const c = (a) => a === !1 ? !1 : s < o.length ? Promise.resolve(o[s++].apply(null, e)).then(c) : a;
|
|
1538
1538
|
n = c();
|
|
1539
1539
|
}
|
|
1540
1540
|
return Promise.resolve(n);
|
|
@@ -1580,13 +1580,13 @@ function requireIndex_cjs$1() {
|
|
|
1580
1580
|
const n = Array.from(this.listeners);
|
|
1581
1581
|
if (n.length > 0) {
|
|
1582
1582
|
let o = 0;
|
|
1583
|
-
const
|
|
1583
|
+
const s = (a) => (_(a), this.onerror(a), e), c = (a) => {
|
|
1584
1584
|
if (ct(e, a)) {
|
|
1585
1585
|
if (e = a, o < n.length)
|
|
1586
1586
|
try {
|
|
1587
|
-
return Promise.resolve(n[o++](e)).then(c,
|
|
1587
|
+
return Promise.resolve(n[o++](e)).then(c, s);
|
|
1588
1588
|
} catch (l) {
|
|
1589
|
-
return
|
|
1589
|
+
return s(l);
|
|
1590
1590
|
}
|
|
1591
1591
|
} else
|
|
1592
1592
|
this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
|
|
@@ -1604,9 +1604,9 @@ function requireIndex_cjs$1() {
|
|
|
1604
1604
|
applyPlugin(e, n) {
|
|
1605
1605
|
d(x(e), "Plugin configuration is invalid.");
|
|
1606
1606
|
const o = e.name;
|
|
1607
|
-
d(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = e, e.apply?.(n), Object.keys(this.lifecycle).forEach((
|
|
1608
|
-
const c = e[
|
|
1609
|
-
c && this.lifecycle[
|
|
1607
|
+
d(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = e, e.apply?.(n), Object.keys(this.lifecycle).forEach((s) => {
|
|
1608
|
+
const c = e[s];
|
|
1609
|
+
c && this.lifecycle[s].on(c);
|
|
1610
1610
|
}));
|
|
1611
1611
|
}
|
|
1612
1612
|
removePlugin(e) {
|
|
@@ -1627,9 +1627,9 @@ function requireIndex_cjs$1() {
|
|
|
1627
1627
|
return {
|
|
1628
1628
|
name: "snapshot-plugin",
|
|
1629
1629
|
async afterResolve(r) {
|
|
1630
|
-
const { remote: e, pkgNameOrAlias: n, expose: o, origin:
|
|
1630
|
+
const { remote: e, pkgNameOrAlias: n, expose: o, origin: s, remoteInfo: c, id: a } = r;
|
|
1631
1631
|
if (!$(e) || !w(e)) {
|
|
1632
|
-
const { remoteSnapshot: l, globalSnapshot: p } = await
|
|
1632
|
+
const { remoteSnapshot: l, globalSnapshot: p } = await s.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1633
1633
|
moduleInfo: e,
|
|
1634
1634
|
id: a
|
|
1635
1635
|
});
|
|
@@ -1643,15 +1643,15 @@ function requireIndex_cjs$1() {
|
|
|
1643
1643
|
share: !1,
|
|
1644
1644
|
depsRemote: !1
|
|
1645
1645
|
}
|
|
1646
|
-
}, b = await
|
|
1647
|
-
origin:
|
|
1646
|
+
}, b = await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1647
|
+
origin: s,
|
|
1648
1648
|
preloadOptions: m,
|
|
1649
1649
|
remoteInfo: c,
|
|
1650
1650
|
remote: e,
|
|
1651
1651
|
remoteSnapshot: l,
|
|
1652
1652
|
globalSnapshot: p
|
|
1653
1653
|
});
|
|
1654
|
-
return b && ke(c,
|
|
1654
|
+
return b && ke(c, s, b, !1), {
|
|
1655
1655
|
...r,
|
|
1656
1656
|
remoteSnapshot: l
|
|
1657
1657
|
};
|
|
@@ -1673,24 +1673,24 @@ function requireIndex_cjs$1() {
|
|
|
1673
1673
|
version: e[2]
|
|
1674
1674
|
};
|
|
1675
1675
|
}
|
|
1676
|
-
function ut(r, e, n, o,
|
|
1676
|
+
function ut(r, e, n, o, s = {}, c) {
|
|
1677
1677
|
const a = R(e), { value: l } = Z(r, a), p = c || l;
|
|
1678
1678
|
if (p && !t.isManifestProvider(p) && (n(p, e, o), p.remotesInfo)) {
|
|
1679
1679
|
const m = Object.keys(p.remotesInfo);
|
|
1680
1680
|
for (const b of m) {
|
|
1681
|
-
if (
|
|
1681
|
+
if (s[b])
|
|
1682
1682
|
continue;
|
|
1683
|
-
|
|
1683
|
+
s[b] = !0;
|
|
1684
1684
|
const S = tr(b), g = p.remotesInfo[b];
|
|
1685
1685
|
ut(r, {
|
|
1686
1686
|
name: S.name,
|
|
1687
1687
|
version: g.matchedVersion
|
|
1688
|
-
}, n, !1,
|
|
1688
|
+
}, n, !1, s, void 0);
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
1692
|
const He = (r, e) => document.querySelector(`${r}[${r === "link" ? "href" : "src"}="${e}"]`);
|
|
1693
|
-
function rr(r, e, n, o,
|
|
1693
|
+
function rr(r, e, n, o, s) {
|
|
1694
1694
|
const c = [], a = [], l = [], p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), { options: b } = r, { preloadConfig: S } = e, { depsRemote: g } = S;
|
|
1695
1695
|
if (ut(o, n, (T, A, G) => {
|
|
1696
1696
|
let L;
|
|
@@ -1739,7 +1739,7 @@ function requireIndex_cjs$1() {
|
|
|
1739
1739
|
}), !Be(Ue) && (L.resourceCategory === "all" ? (c.push(...W(ae.assets.css.async)), c.push(...W(ae.assets.css.sync)), a.push(...W(ae.assets.js.async)), a.push(...W(ae.assets.js.sync))) : (L.resourceCategory = "sync") && (c.push(...W(ae.assets.css.sync)), a.push(...W(ae.assets.js.sync))), qe(Ue));
|
|
1740
1740
|
}
|
|
1741
1741
|
}
|
|
1742
|
-
}, !0, {},
|
|
1742
|
+
}, !0, {}, s), s.shared && s.shared.length > 0) {
|
|
1743
1743
|
const T = (A, G) => {
|
|
1744
1744
|
const L = me(r.shareScopeMap, G.sharedName, A, r.sharedHandler.hooks.lifecycle.resolveShare);
|
|
1745
1745
|
L && typeof L.lib == "function" && (G.assets.js.sync.forEach((q) => {
|
|
@@ -1748,7 +1748,7 @@ function requireIndex_cjs$1() {
|
|
|
1748
1748
|
m.add(q);
|
|
1749
1749
|
}));
|
|
1750
1750
|
};
|
|
1751
|
-
|
|
1751
|
+
s.shared.forEach((A) => {
|
|
1752
1752
|
const G = b.shared?.[A.sharedName];
|
|
1753
1753
|
if (!G)
|
|
1754
1754
|
return;
|
|
@@ -1771,17 +1771,17 @@ function requireIndex_cjs$1() {
|
|
|
1771
1771
|
return {
|
|
1772
1772
|
name: "generate-preload-assets-plugin",
|
|
1773
1773
|
async generatePreloadAssets(r) {
|
|
1774
|
-
const { origin: e, preloadOptions: n, remoteInfo: o, remote:
|
|
1775
|
-
return t.isBrowserEnv() ? $(
|
|
1774
|
+
const { origin: e, preloadOptions: n, remoteInfo: o, remote: s, globalSnapshot: c, remoteSnapshot: a } = r;
|
|
1775
|
+
return t.isBrowserEnv() ? $(s) && w(s) ? {
|
|
1776
1776
|
cssAssets: [],
|
|
1777
1777
|
jsAssetsWithoutEntry: [],
|
|
1778
1778
|
entryAssets: [
|
|
1779
1779
|
{
|
|
1780
|
-
name:
|
|
1781
|
-
url:
|
|
1780
|
+
name: s.name,
|
|
1781
|
+
url: s.entry,
|
|
1782
1782
|
moduleInfo: {
|
|
1783
1783
|
name: o.name,
|
|
1784
|
-
entry:
|
|
1784
|
+
entry: s.entry,
|
|
1785
1785
|
type: o.type || "global",
|
|
1786
1786
|
entryGlobalName: "",
|
|
1787
1787
|
shareScope: ""
|
|
@@ -1828,9 +1828,9 @@ function requireIndex_cjs$1() {
|
|
|
1828
1828
|
}
|
|
1829
1829
|
// eslint-disable-next-line max-lines-per-function
|
|
1830
1830
|
async loadRemoteSnapshotInfo({ moduleInfo: e, id: n, expose: o }) {
|
|
1831
|
-
const { options:
|
|
1831
|
+
const { options: s } = this.HostInstance;
|
|
1832
1832
|
await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
|
|
1833
|
-
options:
|
|
1833
|
+
options: s,
|
|
1834
1834
|
moduleInfo: e
|
|
1835
1835
|
});
|
|
1836
1836
|
let c = he({
|
|
@@ -1850,7 +1850,7 @@ function requireIndex_cjs$1() {
|
|
|
1850
1850
|
}
|
|
1851
1851
|
});
|
|
1852
1852
|
const { hostGlobalSnapshot: a, remoteSnapshot: l, globalSnapshot: p } = this.getGlobalRemoteInfo(e), { remoteSnapshot: m, globalSnapshot: b } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
1853
|
-
options:
|
|
1853
|
+
options: s,
|
|
1854
1854
|
moduleInfo: e,
|
|
1855
1855
|
hostGlobalSnapshot: a,
|
|
1856
1856
|
remoteSnapshot: l,
|
|
@@ -1884,7 +1884,7 @@ function requireIndex_cjs$1() {
|
|
|
1884
1884
|
});
|
|
1885
1885
|
S = j, g = M;
|
|
1886
1886
|
} else
|
|
1887
|
-
E(
|
|
1887
|
+
E(i.getShortErrorMsg(i.RUNTIME_007, i.runtimeDescMap, {
|
|
1888
1888
|
hostName: e.name,
|
|
1889
1889
|
hostVersion: e.version,
|
|
1890
1890
|
globalSnapshot: JSON.stringify(b)
|
|
@@ -1892,7 +1892,7 @@ function requireIndex_cjs$1() {
|
|
|
1892
1892
|
return await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
1893
1893
|
id: n,
|
|
1894
1894
|
host: this.HostInstance,
|
|
1895
|
-
options:
|
|
1895
|
+
options: s,
|
|
1896
1896
|
moduleInfo: e,
|
|
1897
1897
|
remoteSnapshot: S
|
|
1898
1898
|
}), {
|
|
@@ -1904,7 +1904,7 @@ function requireIndex_cjs$1() {
|
|
|
1904
1904
|
return ft(e, this.HostInstance);
|
|
1905
1905
|
}
|
|
1906
1906
|
async getManifestJson(e, n, o) {
|
|
1907
|
-
const
|
|
1907
|
+
const s = async () => {
|
|
1908
1908
|
let a = this.manifestCache.get(e);
|
|
1909
1909
|
if (a)
|
|
1910
1910
|
return a;
|
|
@@ -1918,7 +1918,7 @@ function requireIndex_cjs$1() {
|
|
|
1918
1918
|
from: "runtime",
|
|
1919
1919
|
lifecycle: "afterResolve",
|
|
1920
1920
|
origin: this.HostInstance
|
|
1921
|
-
}), a || (delete this.manifestLoading[e], E(
|
|
1921
|
+
}), a || (delete this.manifestLoading[e], E(i.getShortErrorMsg(i.RUNTIME_003, i.runtimeDescMap, {
|
|
1922
1922
|
manifestUrl: e,
|
|
1923
1923
|
moduleName: n.name,
|
|
1924
1924
|
hostName: this.HostInstance.options.name
|
|
@@ -1926,7 +1926,7 @@ function requireIndex_cjs$1() {
|
|
|
1926
1926
|
}
|
|
1927
1927
|
return d(a.metaData && a.exposes && a.shared, `${e} is not a federation manifest`), this.manifestCache.set(e, a), a;
|
|
1928
1928
|
}, c = async () => {
|
|
1929
|
-
const a = await
|
|
1929
|
+
const a = await s(), l = t.generateSnapshotFromManifest(a, {
|
|
1930
1930
|
version: e
|
|
1931
1931
|
}), { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1932
1932
|
options: this.HostInstance.options,
|
|
@@ -1955,7 +1955,7 @@ function requireIndex_cjs$1() {
|
|
|
1955
1955
|
}
|
|
1956
1956
|
// register shared in shareScopeMap
|
|
1957
1957
|
registerShared(e, n) {
|
|
1958
|
-
const { shareInfos: o, shared:
|
|
1958
|
+
const { shareInfos: o, shared: s } = nt(e, n);
|
|
1959
1959
|
return Object.keys(o).forEach((a) => {
|
|
1960
1960
|
o[a].forEach((p) => {
|
|
1961
1961
|
p.scope.forEach((m) => {
|
|
@@ -1971,23 +1971,23 @@ function requireIndex_cjs$1() {
|
|
|
1971
1971
|
});
|
|
1972
1972
|
}), {
|
|
1973
1973
|
shareInfos: o,
|
|
1974
|
-
shared:
|
|
1974
|
+
shared: s
|
|
1975
1975
|
};
|
|
1976
1976
|
}
|
|
1977
1977
|
async loadShare(e, n) {
|
|
1978
|
-
const { host: o } = this,
|
|
1978
|
+
const { host: o } = this, s = ot({
|
|
1979
1979
|
pkgName: e,
|
|
1980
1980
|
extraOptions: n,
|
|
1981
1981
|
shareInfos: o.options.shared
|
|
1982
1982
|
});
|
|
1983
|
-
|
|
1983
|
+
s?.scope && await Promise.all(s.scope.map(async (m) => {
|
|
1984
1984
|
await Promise.all(this.initializeSharing(m, {
|
|
1985
|
-
strategy:
|
|
1985
|
+
strategy: s.strategy
|
|
1986
1986
|
}));
|
|
1987
1987
|
}));
|
|
1988
1988
|
const c = await this.hooks.lifecycle.beforeLoadShare.emit({
|
|
1989
1989
|
pkgName: e,
|
|
1990
|
-
shareInfo:
|
|
1990
|
+
shareInfo: s,
|
|
1991
1991
|
shared: o.options.shared,
|
|
1992
1992
|
origin: o
|
|
1993
1993
|
}), { shareInfo: a } = c;
|
|
@@ -2039,10 +2039,10 @@ function requireIndex_cjs$1() {
|
|
|
2039
2039
|
*/
|
|
2040
2040
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2041
2041
|
initializeSharing(e = Ee, n) {
|
|
2042
|
-
const { host: o } = this,
|
|
2042
|
+
const { host: o } = this, s = n?.from, c = n?.strategy;
|
|
2043
2043
|
let a = n?.initScope;
|
|
2044
2044
|
const l = [];
|
|
2045
|
-
if (
|
|
2045
|
+
if (s !== "build") {
|
|
2046
2046
|
const { initTokens: M } = this;
|
|
2047
2047
|
a || (a = []);
|
|
2048
2048
|
let j = M[e];
|
|
@@ -2090,20 +2090,20 @@ function requireIndex_cjs$1() {
|
|
|
2090
2090
|
// 2. If lib exists in local shared, it will be used directly
|
|
2091
2091
|
// 3. If the local get returns something other than Promise, then it will be used directly
|
|
2092
2092
|
loadShareSync(e, n) {
|
|
2093
|
-
const { host: o } = this,
|
|
2093
|
+
const { host: o } = this, s = ot({
|
|
2094
2094
|
pkgName: e,
|
|
2095
2095
|
extraOptions: n,
|
|
2096
2096
|
shareInfos: o.options.shared
|
|
2097
2097
|
});
|
|
2098
|
-
|
|
2099
|
-
this.initializeSharing(l, { strategy:
|
|
2098
|
+
s?.scope && s.scope.forEach((l) => {
|
|
2099
|
+
this.initializeSharing(l, { strategy: s.strategy });
|
|
2100
2100
|
});
|
|
2101
|
-
const c = me(this.shareScopeMap, e,
|
|
2101
|
+
const c = me(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare), a = (l) => {
|
|
2102
2102
|
l.useIn || (l.useIn = []), y(l.useIn, o.options.name);
|
|
2103
2103
|
};
|
|
2104
2104
|
if (c) {
|
|
2105
2105
|
if (typeof c.lib == "function")
|
|
2106
|
-
return a(c), c.loaded || (c.loaded = !0, c.from === o.options.name && (
|
|
2106
|
+
return a(c), c.loaded || (c.loaded = !0, c.from === o.options.name && (s.loaded = !0)), c.lib;
|
|
2107
2107
|
if (typeof c.get == "function") {
|
|
2108
2108
|
const l = c.get();
|
|
2109
2109
|
if (!(l instanceof Promise))
|
|
@@ -2116,41 +2116,41 @@ function requireIndex_cjs$1() {
|
|
|
2116
2116
|
}), l;
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
|
-
if (
|
|
2120
|
-
return
|
|
2121
|
-
if (
|
|
2122
|
-
const l =
|
|
2119
|
+
if (s.lib)
|
|
2120
|
+
return s.loaded || (s.loaded = !0), s.lib;
|
|
2121
|
+
if (s.get) {
|
|
2122
|
+
const l = s.get();
|
|
2123
2123
|
if (l instanceof Promise) {
|
|
2124
|
-
const p = n?.from === "build" ?
|
|
2125
|
-
throw new Error(
|
|
2124
|
+
const p = n?.from === "build" ? i.RUNTIME_005 : i.RUNTIME_006;
|
|
2125
|
+
throw new Error(i.getShortErrorMsg(p, i.runtimeDescMap, {
|
|
2126
2126
|
hostName: o.options.name,
|
|
2127
2127
|
sharedPkgName: e
|
|
2128
2128
|
}));
|
|
2129
2129
|
}
|
|
2130
|
-
return
|
|
2130
|
+
return s.lib = l, this.setShared({
|
|
2131
2131
|
pkgName: e,
|
|
2132
2132
|
loaded: !0,
|
|
2133
2133
|
from: o.options.name,
|
|
2134
|
-
lib:
|
|
2135
|
-
shared:
|
|
2136
|
-
}),
|
|
2134
|
+
lib: s.lib,
|
|
2135
|
+
shared: s
|
|
2136
|
+
}), s.lib;
|
|
2137
2137
|
}
|
|
2138
|
-
throw new Error(
|
|
2138
|
+
throw new Error(i.getShortErrorMsg(i.RUNTIME_006, i.runtimeDescMap, {
|
|
2139
2139
|
hostName: o.options.name,
|
|
2140
2140
|
sharedPkgName: e
|
|
2141
2141
|
}));
|
|
2142
2142
|
}
|
|
2143
2143
|
initShareScopeMap(e, n, o = {}) {
|
|
2144
|
-
const { host:
|
|
2144
|
+
const { host: s } = this;
|
|
2145
2145
|
this.shareScopeMap[e] = n, this.hooks.lifecycle.initContainerShareScopeMap.emit({
|
|
2146
2146
|
shareScope: n,
|
|
2147
|
-
options:
|
|
2148
|
-
origin:
|
|
2147
|
+
options: s.options,
|
|
2148
|
+
origin: s,
|
|
2149
2149
|
scopeName: e,
|
|
2150
2150
|
hostShareScopeMap: o.hostShareScopeMap
|
|
2151
2151
|
});
|
|
2152
2152
|
}
|
|
2153
|
-
setShared({ pkgName: e, shared: n, from: o, lib:
|
|
2153
|
+
setShared({ pkgName: e, shared: n, from: o, lib: s, loading: c, loaded: a, get: l }) {
|
|
2154
2154
|
const { version: p, scope: m = "default", ...b } = n;
|
|
2155
2155
|
(Array.isArray(m) ? m : [m]).forEach((g) => {
|
|
2156
2156
|
if (this.shareScopeMap[g] || (this.shareScopeMap[g] = {}), this.shareScopeMap[g][e] || (this.shareScopeMap[g][e] = {}), !this.shareScopeMap[g][e][p]) {
|
|
@@ -2158,7 +2158,7 @@ function requireIndex_cjs$1() {
|
|
|
2158
2158
|
version: p,
|
|
2159
2159
|
scope: [g],
|
|
2160
2160
|
...b,
|
|
2161
|
-
lib:
|
|
2161
|
+
lib: s,
|
|
2162
2162
|
loaded: a,
|
|
2163
2163
|
loading: c
|
|
2164
2164
|
}, l && (this.shareScopeMap[g][e][p].get = l);
|
|
@@ -2190,18 +2190,18 @@ function requireIndex_cjs$1() {
|
|
|
2190
2190
|
}), this.host = e, this.idToRemoteMap = {};
|
|
2191
2191
|
}
|
|
2192
2192
|
formatAndRegisterRemote(e, n) {
|
|
2193
|
-
return (n.remotes || []).reduce((
|
|
2193
|
+
return (n.remotes || []).reduce((s, c) => (this.registerRemote(c, s, { force: !1 }), s), e.remotes);
|
|
2194
2194
|
}
|
|
2195
2195
|
setIdToRemoteMap(e, n) {
|
|
2196
|
-
const { remote: o, expose:
|
|
2197
|
-
if (this.idToRemoteMap[e] = { name: o.name, expose:
|
|
2196
|
+
const { remote: o, expose: s } = n, { name: c, alias: a } = o;
|
|
2197
|
+
if (this.idToRemoteMap[e] = { name: o.name, expose: s }, a && e.startsWith(c)) {
|
|
2198
2198
|
const l = e.replace(c, a);
|
|
2199
|
-
this.idToRemoteMap[l] = { name: o.name, expose:
|
|
2199
|
+
this.idToRemoteMap[l] = { name: o.name, expose: s };
|
|
2200
2200
|
return;
|
|
2201
2201
|
}
|
|
2202
2202
|
if (a && e.startsWith(a)) {
|
|
2203
2203
|
const l = e.replace(a, c);
|
|
2204
|
-
this.idToRemoteMap[l] = { name: o.name, expose:
|
|
2204
|
+
this.idToRemoteMap[l] = { name: o.name, expose: s };
|
|
2205
2205
|
}
|
|
2206
2206
|
}
|
|
2207
2207
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -2209,7 +2209,7 @@ function requireIndex_cjs$1() {
|
|
|
2209
2209
|
async loadRemote(e, n) {
|
|
2210
2210
|
const { host: o } = this;
|
|
2211
2211
|
try {
|
|
2212
|
-
const { loadFactory:
|
|
2212
|
+
const { loadFactory: s = !0 } = n || {
|
|
2213
2213
|
loadFactory: !0
|
|
2214
2214
|
}, { module: c, moduleOptions: a, remoteMatchInfo: l } = await this.getRemoteModuleAndOptions({
|
|
2215
2215
|
id: e
|
|
@@ -2217,24 +2217,24 @@ function requireIndex_cjs$1() {
|
|
|
2217
2217
|
id: S,
|
|
2218
2218
|
pkgNameOrAlias: p,
|
|
2219
2219
|
expose: b,
|
|
2220
|
-
exposeModule:
|
|
2221
|
-
exposeModuleFactory:
|
|
2220
|
+
exposeModule: s ? O : void 0,
|
|
2221
|
+
exposeModuleFactory: s ? void 0 : O,
|
|
2222
2222
|
remote: m,
|
|
2223
2223
|
options: a,
|
|
2224
2224
|
moduleInstance: c,
|
|
2225
2225
|
origin: o
|
|
2226
2226
|
});
|
|
2227
2227
|
return this.setIdToRemoteMap(e, l), typeof M == "function" ? M : O;
|
|
2228
|
-
} catch (
|
|
2228
|
+
} catch (s) {
|
|
2229
2229
|
const { from: c = "runtime" } = n || { from: "runtime" }, a = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2230
2230
|
id: e,
|
|
2231
|
-
error:
|
|
2231
|
+
error: s,
|
|
2232
2232
|
from: c,
|
|
2233
2233
|
lifecycle: "onLoad",
|
|
2234
2234
|
origin: o
|
|
2235
2235
|
});
|
|
2236
2236
|
if (!a)
|
|
2237
|
-
throw
|
|
2237
|
+
throw s;
|
|
2238
2238
|
return a;
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
@@ -2247,12 +2247,12 @@ function requireIndex_cjs$1() {
|
|
|
2247
2247
|
origin: n
|
|
2248
2248
|
});
|
|
2249
2249
|
const o = Jt(n.options.remotes, e);
|
|
2250
|
-
await Promise.all(o.map(async (
|
|
2251
|
-
const { remote: c } =
|
|
2250
|
+
await Promise.all(o.map(async (s) => {
|
|
2251
|
+
const { remote: c } = s, a = Re(c), { globalSnapshot: l, remoteSnapshot: p } = await n.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2252
2252
|
moduleInfo: c
|
|
2253
2253
|
}), m = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2254
2254
|
origin: n,
|
|
2255
|
-
preloadOptions:
|
|
2255
|
+
preloadOptions: s,
|
|
2256
2256
|
remote: c,
|
|
2257
2257
|
remoteInfo: a,
|
|
2258
2258
|
globalSnapshot: l,
|
|
@@ -2263,34 +2263,34 @@ function requireIndex_cjs$1() {
|
|
|
2263
2263
|
}
|
|
2264
2264
|
registerRemotes(e, n) {
|
|
2265
2265
|
const { host: o } = this;
|
|
2266
|
-
e.forEach((
|
|
2267
|
-
this.registerRemote(
|
|
2266
|
+
e.forEach((s) => {
|
|
2267
|
+
this.registerRemote(s, o.options.remotes, {
|
|
2268
2268
|
force: n?.force
|
|
2269
2269
|
});
|
|
2270
2270
|
});
|
|
2271
2271
|
}
|
|
2272
2272
|
async getRemoteModuleAndOptions(e) {
|
|
2273
2273
|
const { host: n } = this, { id: o } = e;
|
|
2274
|
-
let
|
|
2274
|
+
let s;
|
|
2275
2275
|
try {
|
|
2276
|
-
|
|
2276
|
+
s = await this.hooks.lifecycle.beforeRequest.emit({
|
|
2277
2277
|
id: o,
|
|
2278
2278
|
options: n.options,
|
|
2279
2279
|
origin: n
|
|
2280
2280
|
});
|
|
2281
2281
|
} catch (M) {
|
|
2282
|
-
if (
|
|
2282
|
+
if (s = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2283
2283
|
id: o,
|
|
2284
2284
|
options: n.options,
|
|
2285
2285
|
origin: n,
|
|
2286
2286
|
from: "runtime",
|
|
2287
2287
|
error: M,
|
|
2288
2288
|
lifecycle: "beforeRequest"
|
|
2289
|
-
}), !
|
|
2289
|
+
}), !s)
|
|
2290
2290
|
throw M;
|
|
2291
2291
|
}
|
|
2292
|
-
const { id: c } =
|
|
2293
|
-
d(a,
|
|
2292
|
+
const { id: c } = s, a = Le(n.options.remotes, c);
|
|
2293
|
+
d(a, i.getShortErrorMsg(i.RUNTIME_004, i.runtimeDescMap, {
|
|
2294
2294
|
hostName: n.options.name,
|
|
2295
2295
|
requestId: c
|
|
2296
2296
|
}));
|
|
@@ -2314,29 +2314,29 @@ function requireIndex_cjs$1() {
|
|
|
2314
2314
|
};
|
|
2315
2315
|
}
|
|
2316
2316
|
registerRemote(e, n, o) {
|
|
2317
|
-
const { host:
|
|
2317
|
+
const { host: s } = this, c = () => {
|
|
2318
2318
|
if (e.alias) {
|
|
2319
2319
|
const l = n.find((p) => e.alias && (p.name.startsWith(e.alias) || p.alias?.startsWith(e.alias)));
|
|
2320
2320
|
d(!l, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${l && l.name} name or alias`);
|
|
2321
2321
|
}
|
|
2322
2322
|
"entry" in e && t.isBrowserEnv() && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = Ee), e.type || (e.type = We);
|
|
2323
2323
|
};
|
|
2324
|
-
this.hooks.lifecycle.beforeRegisterRemote.emit({ remote: e, origin:
|
|
2324
|
+
this.hooks.lifecycle.beforeRegisterRemote.emit({ remote: e, origin: s });
|
|
2325
2325
|
const a = n.find((l) => l.name === e.name);
|
|
2326
2326
|
if (!a)
|
|
2327
|
-
c(), n.push(e), this.hooks.lifecycle.registerRemote.emit({ remote: e, origin:
|
|
2327
|
+
c(), n.push(e), this.hooks.lifecycle.registerRemote.emit({ remote: e, origin: s });
|
|
2328
2328
|
else {
|
|
2329
2329
|
const l = [
|
|
2330
2330
|
`The remote "${e.name}" is already registered.`,
|
|
2331
2331
|
"Please note that overriding it may cause unexpected errors."
|
|
2332
2332
|
];
|
|
2333
|
-
o?.force && (this.removeRemote(a), c(), n.push(e), this.hooks.lifecycle.registerRemote.emit({ remote: e, origin:
|
|
2333
|
+
o?.force && (this.removeRemote(a), c(), n.push(e), this.hooks.lifecycle.registerRemote.emit({ remote: e, origin: s }), t.warn(l.join(" ")));
|
|
2334
2334
|
}
|
|
2335
2335
|
}
|
|
2336
2336
|
removeRemote(e) {
|
|
2337
2337
|
try {
|
|
2338
|
-
const { host: n } = this, { name: o } = e,
|
|
2339
|
-
|
|
2338
|
+
const { host: n } = this, { name: o } = e, s = n.options.remotes.findIndex((a) => a.name === o);
|
|
2339
|
+
s !== -1 && n.options.remotes.splice(s, 1);
|
|
2340
2340
|
const c = n.moduleCache.get(e.name);
|
|
2341
2341
|
if (c) {
|
|
2342
2342
|
const a = c.remoteInfo, l = a.entryGlobalName;
|
|
@@ -2445,7 +2445,7 @@ function requireIndex_cjs$1() {
|
|
|
2445
2445
|
return this.sharedHandler.initializeSharing(e, n);
|
|
2446
2446
|
}
|
|
2447
2447
|
initRawContainer(e, n, o) {
|
|
2448
|
-
const
|
|
2448
|
+
const s = Re({ name: e, entry: n }), c = new Ce({ host: this, remoteInfo: s });
|
|
2449
2449
|
return c.remoteEntryExports = o, this.moduleCache.set(e, c), c;
|
|
2450
2450
|
}
|
|
2451
2451
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -2461,13 +2461,13 @@ function requireIndex_cjs$1() {
|
|
|
2461
2461
|
this.sharedHandler.initShareScopeMap(e, n, o);
|
|
2462
2462
|
}
|
|
2463
2463
|
formatOptions(e, n) {
|
|
2464
|
-
const { shared: o } = nt(e, n), { userOptions:
|
|
2464
|
+
const { shared: o } = nt(e, n), { userOptions: s, options: c } = this.hooks.lifecycle.beforeInit.emit({
|
|
2465
2465
|
origin: this,
|
|
2466
2466
|
userOptions: n,
|
|
2467
2467
|
options: e,
|
|
2468
2468
|
shareInfo: o
|
|
2469
|
-
}), a = this.remoteHandler.formatAndRegisterRemote(c,
|
|
2470
|
-
|
|
2469
|
+
}), a = this.remoteHandler.formatAndRegisterRemote(c, s), { shared: l } = this.sharedHandler.registerShared(c, s), p = [...c.plugins];
|
|
2470
|
+
s.plugins && s.plugins.forEach((b) => {
|
|
2471
2471
|
p.includes(b) || p.push(b);
|
|
2472
2472
|
});
|
|
2473
2473
|
const m = {
|
|
@@ -2484,7 +2484,7 @@ function requireIndex_cjs$1() {
|
|
|
2484
2484
|
}
|
|
2485
2485
|
registerPlugins(e) {
|
|
2486
2486
|
const n = qt(e, this);
|
|
2487
|
-
this.options.plugins = this.options.plugins.reduce((o,
|
|
2487
|
+
this.options.plugins = this.options.plugins.reduce((o, s) => (s && o && !o.find((c) => c.name === s.name) && o.push(s), o), n || []);
|
|
2488
2488
|
}
|
|
2489
2489
|
registerRemotes(e, n) {
|
|
2490
2490
|
return this.remoteHandler.registerRemotes(e, n);
|
|
@@ -2506,14 +2506,14 @@ function requireUtils_cjs() {
|
|
|
2506
2506
|
if (hasRequiredUtils_cjs) return utils_cjs;
|
|
2507
2507
|
hasRequiredUtils_cjs = 1;
|
|
2508
2508
|
var t = requireIndex_cjs$1();
|
|
2509
|
-
function
|
|
2509
|
+
function i() {
|
|
2510
2510
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? (
|
|
2511
2511
|
//@ts-ignore
|
|
2512
2512
|
FEDERATION_BUILD_IDENTIFIER
|
|
2513
2513
|
) : "";
|
|
2514
2514
|
}
|
|
2515
2515
|
function h(u, d) {
|
|
2516
|
-
const E =
|
|
2516
|
+
const E = i();
|
|
2517
2517
|
return t.CurrentGlobal.__FEDERATION__.__INSTANCES__.find((_) => !!(E && _.options.id === E || _.options.name === u && !_.options.version && !d || _.options.name === u && d && _.options.version === d));
|
|
2518
2518
|
}
|
|
2519
2519
|
return utils_cjs.getGlobalFederationInstance = h, utils_cjs;
|
|
@@ -2522,7 +2522,7 @@ var hasRequiredIndex_cjs;
|
|
|
2522
2522
|
function requireIndex_cjs() {
|
|
2523
2523
|
if (hasRequiredIndex_cjs) return index_cjs$3;
|
|
2524
2524
|
hasRequiredIndex_cjs = 1;
|
|
2525
|
-
var t = requireIndex_cjs$1(),
|
|
2525
|
+
var t = requireIndex_cjs$1(), i = /* @__PURE__ */ requireIndex_cjs$2(), h = requireUtils_cjs();
|
|
2526
2526
|
function u(x) {
|
|
2527
2527
|
const U = t.getGlobalFederationConstructor() || t.ModuleFederation, Q = new U(x);
|
|
2528
2528
|
return t.setGlobalFederationInstance(Q), Q;
|
|
@@ -2533,47 +2533,47 @@ function requireIndex_cjs() {
|
|
|
2533
2533
|
return U ? (U.initOptions(x), d || (d = U), U) : (d = u(x), d);
|
|
2534
2534
|
}
|
|
2535
2535
|
function _(...x) {
|
|
2536
|
-
return t.assert(d,
|
|
2536
|
+
return t.assert(d, i.getShortErrorMsg(i.RUNTIME_009, i.runtimeDescMap)), d.loadRemote.apply(d, x);
|
|
2537
2537
|
}
|
|
2538
2538
|
function y(...x) {
|
|
2539
|
-
return t.assert(d,
|
|
2539
|
+
return t.assert(d, i.getShortErrorMsg(i.RUNTIME_009, i.runtimeDescMap)), d.loadShare.apply(d, x);
|
|
2540
2540
|
}
|
|
2541
2541
|
function R(...x) {
|
|
2542
|
-
return t.assert(d,
|
|
2542
|
+
return t.assert(d, i.getShortErrorMsg(i.RUNTIME_009, i.runtimeDescMap)), d.loadShareSync.apply(d, x);
|
|
2543
2543
|
}
|
|
2544
2544
|
function $(...x) {
|
|
2545
|
-
return t.assert(d,
|
|
2545
|
+
return t.assert(d, i.getShortErrorMsg(i.RUNTIME_009, i.runtimeDescMap)), d.preloadRemote.apply(d, x);
|
|
2546
2546
|
}
|
|
2547
2547
|
function w(...x) {
|
|
2548
|
-
return t.assert(d,
|
|
2548
|
+
return t.assert(d, i.getShortErrorMsg(i.RUNTIME_009, i.runtimeDescMap)), d.registerRemotes.apply(d, x);
|
|
2549
2549
|
}
|
|
2550
2550
|
function C(...x) {
|
|
2551
|
-
return t.assert(d,
|
|
2551
|
+
return t.assert(d, i.getShortErrorMsg(i.RUNTIME_009, i.runtimeDescMap)), d.registerPlugins.apply(d, x);
|
|
2552
2552
|
}
|
|
2553
2553
|
function H() {
|
|
2554
2554
|
return d;
|
|
2555
2555
|
}
|
|
2556
2556
|
function B(...x) {
|
|
2557
|
-
return t.assert(d,
|
|
2557
|
+
return t.assert(d, i.getShortErrorMsg(i.RUNTIME_009, i.runtimeDescMap)), d.registerShared.apply(d, x);
|
|
2558
2558
|
}
|
|
2559
2559
|
return t.setGlobalFederationConstructor(t.ModuleFederation), index_cjs$3.Module = t.Module, index_cjs$3.ModuleFederation = t.ModuleFederation, index_cjs$3.getRemoteEntry = t.getRemoteEntry, index_cjs$3.getRemoteInfo = t.getRemoteInfo, index_cjs$3.loadScript = t.loadScript, index_cjs$3.loadScriptNode = t.loadScriptNode, index_cjs$3.registerGlobalPlugins = t.registerGlobalPlugins, index_cjs$3.createInstance = u, index_cjs$3.getInstance = H, index_cjs$3.init = E, index_cjs$3.loadRemote = _, index_cjs$3.loadShare = y, index_cjs$3.loadShareSync = R, index_cjs$3.preloadRemote = $, index_cjs$3.registerPlugins = C, index_cjs$3.registerRemotes = w, index_cjs$3.registerShared = B, index_cjs$3;
|
|
2560
2560
|
}
|
|
2561
2561
|
var hasRequiredRuntime_cjs;
|
|
2562
2562
|
function requireRuntime_cjs() {
|
|
2563
2563
|
return hasRequiredRuntime_cjs || (hasRequiredRuntime_cjs = 1, (function(t) {
|
|
2564
|
-
var
|
|
2565
|
-
Object.prototype.hasOwnProperty.call(
|
|
2564
|
+
var i = requireIndex_cjs();
|
|
2565
|
+
Object.prototype.hasOwnProperty.call(i, "__proto__") && !Object.prototype.hasOwnProperty.call(t, "__proto__") && Object.defineProperty(t, "__proto__", {
|
|
2566
2566
|
enumerable: !0,
|
|
2567
|
-
value:
|
|
2568
|
-
}), Object.keys(
|
|
2569
|
-
h !== "default" && !Object.prototype.hasOwnProperty.call(t, h) && (t[h] =
|
|
2567
|
+
value: i.__proto__
|
|
2568
|
+
}), Object.keys(i).forEach(function(h) {
|
|
2569
|
+
h !== "default" && !Object.prototype.hasOwnProperty.call(t, h) && (t[h] = i[h]);
|
|
2570
2570
|
});
|
|
2571
2571
|
})(runtime_cjs)), runtime_cjs;
|
|
2572
2572
|
}
|
|
2573
2573
|
var hasRequiredRuntime;
|
|
2574
2574
|
function requireRuntime() {
|
|
2575
2575
|
return hasRequiredRuntime || (hasRequiredRuntime = 1, (function(t) {
|
|
2576
|
-
var
|
|
2576
|
+
var i = runtime && runtime.__createBinding || (Object.create ? (function(u, d, E, _) {
|
|
2577
2577
|
_ === void 0 && (_ = E);
|
|
2578
2578
|
var y = Object.getOwnPropertyDescriptor(d, E);
|
|
2579
2579
|
(!y || ("get" in y ? !d.__esModule : y.writable || y.configurable)) && (y = { enumerable: !0, get: function() {
|
|
@@ -2582,17 +2582,17 @@ function requireRuntime() {
|
|
|
2582
2582
|
}) : (function(u, d, E, _) {
|
|
2583
2583
|
_ === void 0 && (_ = E), u[_] = d[E];
|
|
2584
2584
|
})), h = runtime && runtime.__exportStar || function(u, d) {
|
|
2585
|
-
for (var E in u) E !== "default" && !Object.prototype.hasOwnProperty.call(d, E) &&
|
|
2585
|
+
for (var E in u) E !== "default" && !Object.prototype.hasOwnProperty.call(d, E) && i(d, u, E);
|
|
2586
2586
|
};
|
|
2587
2587
|
Object.defineProperty(t, "__esModule", { value: !0 }), h(requireRuntime_cjs(), t);
|
|
2588
2588
|
})(runtime)), runtime;
|
|
2589
2589
|
}
|
|
2590
2590
|
var runtimeExports = requireRuntime();
|
|
2591
2591
|
const loadAsyncComponent = (t) => defineAsyncComponent(
|
|
2592
|
-
() => runtimeExports.loadRemote(t).then((
|
|
2593
|
-
if (!
|
|
2592
|
+
() => runtimeExports.loadRemote(t).then((i) => {
|
|
2593
|
+
if (!i?.default)
|
|
2594
2594
|
throw new Error(`Failed to load component from ${t}`);
|
|
2595
|
-
return
|
|
2595
|
+
return i.default;
|
|
2596
2596
|
})
|
|
2597
2597
|
);
|
|
2598
2598
|
const IS_CLIENT = typeof window < "u";
|
|
@@ -2610,9 +2610,9 @@ var MutationType;
|
|
|
2610
2610
|
(function(t) {
|
|
2611
2611
|
t.direct = "direct", t.patchObject = "patch object", t.patchFunction = "patch function";
|
|
2612
2612
|
})(MutationType || (MutationType = {}));
|
|
2613
|
-
function patchObject(t,
|
|
2614
|
-
for (const h in
|
|
2615
|
-
const u =
|
|
2613
|
+
function patchObject(t, i) {
|
|
2614
|
+
for (const h in i) {
|
|
2615
|
+
const u = i[h];
|
|
2616
2616
|
if (!(h in t))
|
|
2617
2617
|
continue;
|
|
2618
2618
|
const d = t[h];
|
|
@@ -2622,25 +2622,25 @@ function patchObject(t, s) {
|
|
|
2622
2622
|
}
|
|
2623
2623
|
const noop = () => {
|
|
2624
2624
|
};
|
|
2625
|
-
function addSubscription(t,
|
|
2626
|
-
t.add(
|
|
2625
|
+
function addSubscription(t, i, h, u = noop) {
|
|
2626
|
+
t.add(i);
|
|
2627
2627
|
const d = () => {
|
|
2628
|
-
t.delete(
|
|
2628
|
+
t.delete(i) && u();
|
|
2629
2629
|
};
|
|
2630
2630
|
return !h && getCurrentScope() && onScopeDispose(d), d;
|
|
2631
2631
|
}
|
|
2632
|
-
function triggerSubscriptions(t, ...
|
|
2632
|
+
function triggerSubscriptions(t, ...i) {
|
|
2633
2633
|
t.forEach((h) => {
|
|
2634
|
-
h(...
|
|
2634
|
+
h(...i);
|
|
2635
2635
|
});
|
|
2636
2636
|
}
|
|
2637
2637
|
const fallbackRunWithContext = (t) => t(), ACTION_MARKER = Symbol(), ACTION_NAME = Symbol();
|
|
2638
|
-
function mergeReactiveObjects(t,
|
|
2639
|
-
t instanceof Map &&
|
|
2640
|
-
for (const h in
|
|
2641
|
-
if (!
|
|
2638
|
+
function mergeReactiveObjects(t, i) {
|
|
2639
|
+
t instanceof Map && i instanceof Map ? i.forEach((h, u) => t.set(u, h)) : t instanceof Set && i instanceof Set && i.forEach(t.add, t);
|
|
2640
|
+
for (const h in i) {
|
|
2641
|
+
if (!i.hasOwnProperty(h))
|
|
2642
2642
|
continue;
|
|
2643
|
-
const u =
|
|
2643
|
+
const u = i[h], d = t[h];
|
|
2644
2644
|
isPlainObject(d) && isPlainObject(u) && t.hasOwnProperty(h) && !isRef(u) && !isReactive(u) ? t[h] = mergeReactiveObjects(d, u) : t[h] = u;
|
|
2645
2645
|
}
|
|
2646
2646
|
return t;
|
|
@@ -2656,8 +2656,8 @@ const { assign } = Object;
|
|
|
2656
2656
|
function isComputed(t) {
|
|
2657
2657
|
return !!(isRef(t) && t.effect);
|
|
2658
2658
|
}
|
|
2659
|
-
function createOptionsStore(t,
|
|
2660
|
-
const { state: d, actions: E, getters: _ } =
|
|
2659
|
+
function createOptionsStore(t, i, h, u) {
|
|
2660
|
+
const { state: d, actions: E, getters: _ } = i, y = h.state.value[t];
|
|
2661
2661
|
let R;
|
|
2662
2662
|
function $() {
|
|
2663
2663
|
!y && (process.env.NODE_ENV === "production" || !u) && (h.state.value[t] = d ? d() : {});
|
|
@@ -2671,9 +2671,9 @@ function createOptionsStore(t, s, h, u) {
|
|
|
2671
2671
|
return _[H].call(B, B);
|
|
2672
2672
|
})), C), {}));
|
|
2673
2673
|
}
|
|
2674
|
-
return R = createSetupStore(t, $,
|
|
2674
|
+
return R = createSetupStore(t, $, i, h, u, !0), R;
|
|
2675
2675
|
}
|
|
2676
|
-
function createSetupStore(t,
|
|
2676
|
+
function createSetupStore(t, i, h = {}, u, d, E) {
|
|
2677
2677
|
let _;
|
|
2678
2678
|
const y = assign({ actions: {} }, h);
|
|
2679
2679
|
if (process.env.NODE_ENV !== "production" && !u._e.active)
|
|
@@ -2780,7 +2780,7 @@ function createSetupStore(t, s, h = {}, u, d, E) {
|
|
|
2780
2780
|
// setupStore
|
|
2781
2781
|
) : ee);
|
|
2782
2782
|
u._s.set(t, v);
|
|
2783
|
-
const ne = (u._a && u._a.runWithContext || fallbackRunWithContext)(() => u._e.run(() => (_ = effectScope()).run(() =>
|
|
2783
|
+
const ne = (u._a && u._a.runWithContext || fallbackRunWithContext)(() => u._e.run(() => (_ = effectScope()).run(() => i({ action: F }))));
|
|
2784
2784
|
for (const I in ne) {
|
|
2785
2785
|
const N = ne[I];
|
|
2786
2786
|
if (isRef(N) && !isComputed(N) || isReactive(N))
|
|
@@ -2865,10 +2865,10 @@ function createSetupStore(t, s, h = {}, u, d, E) {
|
|
|
2865
2865
|
Found in store "${v.$id}".`), x && E && h.hydrate && h.hydrate(v.$state, x), $ = !0, w = !0, v;
|
|
2866
2866
|
}
|
|
2867
2867
|
// @__NO_SIDE_EFFECTS__
|
|
2868
|
-
function defineStore(t,
|
|
2868
|
+
function defineStore(t, i, h) {
|
|
2869
2869
|
let u;
|
|
2870
|
-
const d = typeof
|
|
2871
|
-
u = d ? h :
|
|
2870
|
+
const d = typeof i == "function";
|
|
2871
|
+
u = d ? h : i;
|
|
2872
2872
|
function E(_, y) {
|
|
2873
2873
|
const R = hasInjectionContext();
|
|
2874
2874
|
if (_ = // in test mode, ignore the argument provided as we can always retrieve a
|
|
@@ -2877,10 +2877,10 @@ function defineStore(t, s, h) {
|
|
|
2877
2877
|
throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
2878
2878
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
2879
2879
|
This will fail in production.`);
|
|
2880
|
-
_ = activePinia, _._s.has(t) || (d ? createSetupStore(t,
|
|
2880
|
+
_ = activePinia, _._s.has(t) || (d ? createSetupStore(t, i, u, _) : createOptionsStore(t, u, _), process.env.NODE_ENV !== "production" && (E._pinia = _));
|
|
2881
2881
|
const $ = _._s.get(t);
|
|
2882
2882
|
if (process.env.NODE_ENV !== "production" && y) {
|
|
2883
|
-
const w = "__hot:" + t, C = d ? createSetupStore(w,
|
|
2883
|
+
const w = "__hot:" + t, C = d ? createSetupStore(w, i, u, _, !0) : createOptionsStore(w, assign({}, u), _, !0);
|
|
2884
2884
|
y._hotUpdate(C), delete _.state.value[w], _._s.delete(w);
|
|
2885
2885
|
}
|
|
2886
2886
|
if (process.env.NODE_ENV !== "production" && IS_CLIENT) {
|
|
@@ -2905,8 +2905,8 @@ const useLinidZoneStore = /* @__PURE__ */ defineStore("linidZoneStore", {
|
|
|
2905
2905
|
* @param zone - The name of the zone.
|
|
2906
2906
|
* @param entry - The entry to register.
|
|
2907
2907
|
*/
|
|
2908
|
-
register(t,
|
|
2909
|
-
this.zones[t] || (this.zones[t] = []), this.zones[t].push(
|
|
2908
|
+
register(t, i) {
|
|
2909
|
+
this.zones[t] || (this.zones[t] = []), this.zones[t].push(i);
|
|
2910
2910
|
}
|
|
2911
2911
|
}
|
|
2912
2912
|
}), _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -2915,10 +2915,10 @@ const useLinidZoneStore = /* @__PURE__ */ defineStore("linidZoneStore", {
|
|
|
2915
2915
|
zone: {}
|
|
2916
2916
|
},
|
|
2917
2917
|
setup(t) {
|
|
2918
|
-
const
|
|
2918
|
+
const i = t, h = useLinidZoneStore(), u = ref([]), d = ref(!1);
|
|
2919
2919
|
return watchEffect(() => {
|
|
2920
2920
|
d.value = !1;
|
|
2921
|
-
const E = h.zones[
|
|
2921
|
+
const E = h.zones[i.zone] || [];
|
|
2922
2922
|
u.value = E.map((_) => ({
|
|
2923
2923
|
..._,
|
|
2924
2924
|
component: loadAsyncComponent(_.plugin)
|
|
@@ -2935,7 +2935,7 @@ const useLinidZoneStore = /* @__PURE__ */ defineStore("linidZoneStore", {
|
|
|
2935
2935
|
], 64));
|
|
2936
2936
|
}
|
|
2937
2937
|
});
|
|
2938
|
-
var ModuleLifecyclePhase = /* @__PURE__ */ ((t) => (t.SETUP = "setup", t.CONFIGURE = "configure", t.INITIALIZE = "initialize", t.READY = "ready", t.POST_INIT = "
|
|
2938
|
+
var ModuleLifecyclePhase = /* @__PURE__ */ ((t) => (t.SETUP = "setup", t.CONFIGURE = "configure", t.INITIALIZE = "initialize", t.READY = "ready", t.POST_INIT = "postInit", t))(ModuleLifecyclePhase || {});
|
|
2939
2939
|
class BasicRemoteModule {
|
|
2940
2940
|
/**
|
|
2941
2941
|
* Unique identifier for the module.
|
|
@@ -2962,8 +2962,8 @@ class BasicRemoteModule {
|
|
|
2962
2962
|
* @param version - Module version (semver).
|
|
2963
2963
|
* @param description - Optional module description.
|
|
2964
2964
|
*/
|
|
2965
|
-
constructor(
|
|
2966
|
-
this.id =
|
|
2965
|
+
constructor(i, h, u, d) {
|
|
2966
|
+
this.id = i, this.name = h, this.version = u, this.description = d;
|
|
2967
2967
|
}
|
|
2968
2968
|
/**
|
|
2969
2969
|
* Setup phase - validate dependencies and prepare the module.
|
|
@@ -2973,10 +2973,9 @@ class BasicRemoteModule {
|
|
|
2973
2973
|
*
|
|
2974
2974
|
* Default implementation returns success.
|
|
2975
2975
|
* Override this method to add custom setup logic.
|
|
2976
|
-
* @param _app - The Vue application instance.
|
|
2977
2976
|
* @returns Promise resolving to the lifecycle result.
|
|
2978
2977
|
*/
|
|
2979
|
-
async
|
|
2978
|
+
async setup() {
|
|
2980
2979
|
return { success: !0 };
|
|
2981
2980
|
}
|
|
2982
2981
|
/**
|
|
@@ -2987,11 +2986,10 @@ class BasicRemoteModule {
|
|
|
2987
2986
|
*
|
|
2988
2987
|
* Default implementation returns success.
|
|
2989
2988
|
* Override this method to add custom configuration logic.
|
|
2990
|
-
* @param
|
|
2991
|
-
* @param _config - Module-specific configuration from host.
|
|
2989
|
+
* @param config - Module-specific configuration from host.
|
|
2992
2990
|
* @returns Promise resolving to the lifecycle result.
|
|
2993
2991
|
*/
|
|
2994
|
-
async
|
|
2992
|
+
async configure(i) {
|
|
2995
2993
|
return { success: !0 };
|
|
2996
2994
|
}
|
|
2997
2995
|
/**
|
|
@@ -3002,10 +3000,9 @@ class BasicRemoteModule {
|
|
|
3002
3000
|
*
|
|
3003
3001
|
* Default implementation returns success.
|
|
3004
3002
|
* Override this method to add custom initialization logic.
|
|
3005
|
-
* @param _app - The Vue application instance.
|
|
3006
3003
|
* @returns Promise resolving to the lifecycle result.
|
|
3007
3004
|
*/
|
|
3008
|
-
async
|
|
3005
|
+
async initialize() {
|
|
3009
3006
|
return { success: !0 };
|
|
3010
3007
|
}
|
|
3011
3008
|
/**
|
|
@@ -3016,10 +3013,9 @@ class BasicRemoteModule {
|
|
|
3016
3013
|
*
|
|
3017
3014
|
* Default implementation returns success.
|
|
3018
3015
|
* Override this method to add custom ready logic.
|
|
3019
|
-
* @param _app - The Vue application instance.
|
|
3020
3016
|
* @returns Promise resolving to the lifecycle result.
|
|
3021
3017
|
*/
|
|
3022
|
-
async
|
|
3018
|
+
async ready() {
|
|
3023
3019
|
return { success: !0 };
|
|
3024
3020
|
}
|
|
3025
3021
|
/**
|
|
@@ -3030,10 +3026,9 @@ class BasicRemoteModule {
|
|
|
3030
3026
|
*
|
|
3031
3027
|
* Default implementation returns success.
|
|
3032
3028
|
* Override this method to add custom post-init logic.
|
|
3033
|
-
* @param _app - The Vue application instance.
|
|
3034
3029
|
* @returns Promise resolving to the lifecycle result.
|
|
3035
3030
|
*/
|
|
3036
|
-
async
|
|
3031
|
+
async postInit() {
|
|
3037
3032
|
return { success: !0 };
|
|
3038
3033
|
}
|
|
3039
3034
|
}
|