@appshell/react 1.0.0-alpha.14 → 1.0.0-alpha.16
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/CHANGELOG.md +11 -0
- package/README.md +36 -49
- package/__tests__/{AppshellComponent.spec.tsx → RemoteSlot.spec.tsx} +6 -13
- package/__tests__/__snapshots__/{AppshellComponent.spec.tsx.snap → RemoteSlot.spec.tsx.snap} +1 -1
- package/__tests__/fixtures/Manifest.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/types/config/src/context.d.ts +3 -3
- package/dist/types/config/src/credentials.d.ts +0 -1
- package/dist/types/config/src/credentials.d.ts.map +1 -1
- package/dist/types/config/src/index.d.ts +2 -6
- package/dist/types/config/src/index.d.ts.map +1 -1
- package/dist/types/config/src/publish.d.ts +3 -3
- package/dist/types/config/src/publish.d.ts.map +1 -1
- package/dist/types/config/src/types.d.ts +9 -14
- package/dist/types/config/src/types.d.ts.map +1 -1
- package/dist/types/config/src/utils/index.d.ts +0 -3
- package/dist/types/config/src/utils/index.d.ts.map +1 -1
- package/dist/types/config/src/validators/index.d.ts +0 -2
- package/dist/types/config/src/validators/index.d.ts.map +1 -1
- package/dist/types/loader/src/remoteLoader.d.ts +2 -3
- package/dist/types/loader/src/remoteLoader.d.ts.map +1 -1
- package/dist/types/loader/src/resolvers.d.ts +4 -11
- package/dist/types/loader/src/resolvers.d.ts.map +1 -1
- package/dist/types/react/src/components/{AppshellComponent.d.ts → RemoteSlot.d.ts} +5 -21
- package/dist/types/react/src/components/RemoteSlot.d.ts.map +1 -0
- package/dist/types/react/src/hooks/useRemote.d.ts +1 -1
- package/dist/types/react/src/hooks/useRemote.d.ts.map +1 -1
- package/dist/types/react/src/index.d.ts +1 -8
- package/dist/types/react/src/index.d.ts.map +1 -1
- package/dist/types/runtime/src/errors.d.ts +26 -0
- package/dist/types/runtime/src/errors.d.ts.map +1 -0
- package/dist/types/runtime/src/index.d.ts +4 -0
- package/dist/types/runtime/src/index.d.ts.map +1 -0
- package/dist/types/runtime/src/store.d.ts +26 -0
- package/dist/types/runtime/src/store.d.ts.map +1 -0
- package/dist/types/runtime/src/types.d.ts +10 -0
- package/dist/types/runtime/src/types.d.ts.map +1 -0
- package/package.json +9 -3
- package/src/components/{AppshellComponent.tsx → RemoteSlot.tsx} +12 -29
- package/src/hooks/useRemote.ts +1 -1
- package/src/index.ts +1 -8
- package/webpack.config.js +3 -0
- package/__tests__/ManifestContext.spec.tsx +0 -50
- package/__tests__/ReactHost.spec.tsx +0 -136
- package/__tests__/__snapshots__/ReactHost.spec.tsx.snap +0 -11
- package/__tests__/fixtures/TestGlobalConfig.ts +0 -8
- package/dist/types/config/src/deregister.d.ts +0 -3
- package/dist/types/config/src/deregister.d.ts.map +0 -1
- package/dist/types/config/src/generate.env.d.ts +0 -3
- package/dist/types/config/src/generate.env.d.ts.map +0 -1
- package/dist/types/config/src/generate.global-config.d.ts +0 -10
- package/dist/types/config/src/generate.global-config.d.ts.map +0 -1
- package/dist/types/config/src/register.d.ts +0 -4
- package/dist/types/config/src/register.d.ts.map +0 -1
- package/dist/types/config/src/utils/isValidUrl.d.ts +0 -3
- package/dist/types/config/src/utils/isValidUrl.d.ts.map +0 -1
- package/dist/types/config/src/utils/loadJson.d.ts +0 -10
- package/dist/types/config/src/utils/loadJson.d.ts.map +0 -1
- package/dist/types/config/src/utils/merge.d.ts +0 -4
- package/dist/types/config/src/utils/merge.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts +0 -4
- package/dist/types/config/src/validators/AppshellGlobalConfigValidator.d.ts.map +0 -1
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts +0 -4
- package/dist/types/config/src/validators/AppshellManifestValidator.d.ts.map +0 -1
- package/dist/types/react/src/components/AppshellComponent.d.ts.map +0 -1
- package/dist/types/react/src/components/ReactHost.d.ts +0 -9
- package/dist/types/react/src/components/ReactHost.d.ts.map +0 -1
- package/dist/types/react/src/contexts/GlobalConfigContext.d.ts +0 -11
- package/dist/types/react/src/contexts/GlobalConfigContext.d.ts.map +0 -1
- package/dist/types/react/src/contexts/ManifestContext.d.ts +0 -12
- package/dist/types/react/src/contexts/ManifestContext.d.ts.map +0 -1
- package/dist/types/react/src/contexts/MetadataContext.d.ts +0 -11
- package/dist/types/react/src/contexts/MetadataContext.d.ts.map +0 -1
- package/dist/types/react/src/hooks/useGlobalConfig.d.ts +0 -4
- package/dist/types/react/src/hooks/useGlobalConfig.d.ts.map +0 -1
- package/dist/types/react/src/hooks/useManifest.d.ts +0 -4
- package/dist/types/react/src/hooks/useManifest.d.ts.map +0 -1
- package/dist/types/react/src/hooks/useMetadata.d.ts +0 -4
- package/dist/types/react/src/hooks/useMetadata.d.ts.map +0 -1
- package/src/components/ReactHost.tsx +0 -55
- package/src/contexts/GlobalConfigContext.tsx +0 -17
- package/src/contexts/ManifestContext.tsx +0 -40
- package/src/contexts/MetadataContext.tsx +0 -17
- package/src/hooks/useGlobalConfig.ts +0 -7
- package/src/hooks/useManifest.ts +0 -7
- package/src/hooks/useMetadata.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.16](https://github.com/appshellhq/appshell/compare/v1.0.0-alpha.14...v1.0.0-alpha.16) (2026-08-27)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **react:** rename MetadataProvider prop metata -> metadata ([63ef090](https://github.com/appshellhq/appshell/commit/63ef090b29789df45d591a9a0b33bacc55477350))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- deliver package vars through a shared runtime, not a global ([9473f62](https://github.com/appshellhq/appshell/commit/9473f6204b75885cd55b12a9ec71a44a74d6aa41))
|
|
15
|
+
- rename core vocabulary to Package / Application / Remote ([418b7e0](https://github.com/appshellhq/appshell/commit/418b7e010b6caa1af661f7fd9c05e751e69315a9))
|
|
16
|
+
|
|
6
17
|
# [1.0.0-alpha.14](https://github.com/appshell-org/appshell/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2026-08-23)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @appshell/react
|
package/README.md
CHANGED
|
@@ -20,57 +20,44 @@ Working examples can be found [here](https://github.com/navaris/appshell/tree/ma
|
|
|
20
20
|
To begin, you'll need to install `@appshell/react`:
|
|
21
21
|
|
|
22
22
|
```console
|
|
23
|
-
npm install @appshell/react
|
|
23
|
+
npm install @appshell/react
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
or
|
|
27
27
|
|
|
28
28
|
```console
|
|
29
|
-
yarn add
|
|
29
|
+
yarn add @appshell/react
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
or
|
|
33
33
|
|
|
34
34
|
```console
|
|
35
|
-
pnpm add
|
|
35
|
+
pnpm add @appshell/react
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## RemoteSlot
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Where a remote is mounted. The slot resolves the remote key against the composition,
|
|
41
|
+
loads it over Module Federation, renders `fallback` while that is in flight, and
|
|
42
|
+
surfaces a load failure in place rather than taking the page down with it.
|
|
41
43
|
|
|
42
44
|
```tsx
|
|
43
|
-
import {
|
|
45
|
+
import { RemoteSlot } from '@appshell/react';
|
|
44
46
|
|
|
45
47
|
<App>
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
<AppshellComponent remote="PongModule/Pong">
|
|
49
|
-
</ManifestProvider>
|
|
48
|
+
<RemoteSlot remote="PingModule/Ping" fallback={<Spinner />} />
|
|
49
|
+
<RemoteSlot remote="PongModule/Pong" fallback={<Spinner />} />
|
|
50
50
|
</App>
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Any other props are passed through to the mounted remote.
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
import { GlobalConfigProvider, useGlobalConfig } from '@appshell/react';
|
|
59
|
-
|
|
60
|
-
const MyComponent = () => {
|
|
61
|
-
const config = useGlobalConfig();
|
|
62
|
-
|
|
63
|
-
...
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
<RegistryProvider config={config}>
|
|
67
|
-
<MyComponent />
|
|
68
|
-
</RegistryProvider>
|
|
69
|
-
```
|
|
55
|
+
The registry inlines the composition into the document it serves, so the component
|
|
56
|
+
needs no configuration of its own.
|
|
70
57
|
|
|
71
58
|
## useRemote
|
|
72
59
|
|
|
73
|
-
For access to the remote backing the surrounding `
|
|
60
|
+
For access to the remote backing the surrounding `RemoteSlot`. Prefer this
|
|
74
61
|
over looking your own entry up in the manifest — the component already knows its key.
|
|
75
62
|
|
|
76
63
|
```tsx
|
|
@@ -83,36 +70,36 @@ const MyComponent = () => {
|
|
|
83
70
|
}
|
|
84
71
|
```
|
|
85
72
|
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
For access to the manifest.
|
|
73
|
+
## RemoteProvider
|
|
89
74
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
75
|
+
Supplies the remote a subtree is running as. `RemoteSlot` wraps what it mounts in one
|
|
76
|
+
already, so you rarely construct it yourself — reach for it in tests, where it is what
|
|
77
|
+
makes `useRemote` return something.
|
|
93
78
|
|
|
94
79
|
```tsx
|
|
95
|
-
import {
|
|
80
|
+
import { RemoteProvider } from '@appshell/react';
|
|
96
81
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<ManifestProvider manifest={manifest}>
|
|
104
|
-
<MyComponent />
|
|
105
|
-
</ManifestProvider>
|
|
82
|
+
render(
|
|
83
|
+
<RemoteProvider remote={manifest.remotes['PingModule/Ping']}>
|
|
84
|
+
<Ping />
|
|
85
|
+
</RemoteProvider>,
|
|
86
|
+
);
|
|
106
87
|
```
|
|
107
88
|
|
|
108
|
-
|
|
89
|
+
## jsonResource
|
|
109
90
|
|
|
110
|
-
|
|
91
|
+
Wraps a fetch in a Suspense-compatible resource, so a component can read JSON during
|
|
92
|
+
render instead of threading loading state through it.
|
|
111
93
|
|
|
112
|
-
|
|
94
|
+
```tsx
|
|
95
|
+
import { jsonResource } from '@appshell/react';
|
|
113
96
|
|
|
114
|
-
|
|
97
|
+
const settings = jsonResource<Settings>('/api/settings');
|
|
115
98
|
|
|
116
|
-
|
|
117
|
-
appshell register --manifest dist/appshell.manifest.json
|
|
99
|
+
const Panel = () => <pre>{settings.read().theme}</pre>;
|
|
118
100
|
```
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
[MIT](./LICENSE)
|
|
105
|
+
|
|
@@ -3,23 +3,18 @@ import * as remoteLoader from '@appshell/loader';
|
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
4
|
import { act, render, screen } from '@testing-library/react';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import
|
|
7
|
-
import * as useGlobalConfig from '../src/hooks/useGlobalConfig';
|
|
6
|
+
import RemoteSlot from '../src/components/RemoteSlot';
|
|
8
7
|
import manifest from './fixtures/Manifest';
|
|
9
8
|
import TestComponent from './fixtures/TestComponent';
|
|
10
|
-
import config from './fixtures/TestGlobalConfig';
|
|
11
|
-
|
|
12
|
-
jest.mock('../src/hooks/useGlobalConfig');
|
|
13
9
|
|
|
14
10
|
const TestFallback = () => <div>loading...</div>;
|
|
15
11
|
|
|
16
|
-
describe('
|
|
12
|
+
describe('RemoteSlot', () => {
|
|
17
13
|
it('should match snapshot', async () => {
|
|
18
|
-
jest.spyOn(
|
|
19
|
-
jest.spyOn(remoteLoader, 'default').mockReturnValueOnce(async () => [TestComponent, manifest]);
|
|
14
|
+
jest.spyOn(remoteLoader, 'default').mockReturnValueOnce(async () => [TestComponent, manifest.remotes['TestModule/TestComponent']]);
|
|
20
15
|
|
|
21
16
|
const { container, findByText } = await act(() =>
|
|
22
|
-
render(<
|
|
17
|
+
render(<RemoteSlot remote="TestModule/TestComponent" />),
|
|
23
18
|
);
|
|
24
19
|
const view = await findByText(/test component/i);
|
|
25
20
|
|
|
@@ -28,24 +23,22 @@ describe('AppshellComponent', () => {
|
|
|
28
23
|
});
|
|
29
24
|
|
|
30
25
|
it('should render fallback while resource is pending', async () => {
|
|
31
|
-
jest.spyOn(useGlobalConfig, 'default').mockReturnValue(config);
|
|
32
26
|
jest.spyOn(remoteLoader, 'default').mockReturnValueOnce(() => [null, null]);
|
|
33
27
|
|
|
34
28
|
await act(() =>
|
|
35
|
-
render(<
|
|
29
|
+
render(<RemoteSlot remote="TestModule/TestComponent" fallback={<TestFallback />} />),
|
|
36
30
|
);
|
|
37
31
|
|
|
38
32
|
expect(screen.getByText(/loading/i)).toBeInTheDocument();
|
|
39
33
|
});
|
|
40
34
|
|
|
41
35
|
it('should render error when resource fails', async () => {
|
|
42
|
-
jest.spyOn(useGlobalConfig, 'default').mockReturnValue(config);
|
|
43
36
|
jest
|
|
44
37
|
.spyOn(remoteLoader, 'default')
|
|
45
38
|
.mockImplementationOnce(() => new Error('Failed to get resource'));
|
|
46
39
|
|
|
47
40
|
await act(() =>
|
|
48
|
-
render(<
|
|
41
|
+
render(<RemoteSlot remote="TestModule/TestComponent" fallback={<TestFallback />} />),
|
|
49
42
|
);
|
|
50
43
|
|
|
51
44
|
expect(screen.getByText(/Error loading Appshell component/i)).toBeInTheDocument();
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var o="object"==typeof exports?t(require("react")):t(e.react);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,(e=>(()=>{"use strict";var t={155(t){t.exports=e}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{AppshellComponent:()=>Go,FederatedComponent:()=>Bo,GlobalConfigProvider:()=>jo,ManifestProvider:()=>Ao,MetadataProvider:()=>Zo,ReactHost:()=>zo,RemoteProvider:()=>Mo,jsonResource:()=>er,useGlobalConfig:()=>Ho,useManifest:()=>Yo,useMetadata:()=>Xo,useRemote:()=>Qo});const s=".json",i="FEDERATION_DEBUG";let a=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const c="undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:"undefined"!=typeof window&&void 0!==window.document;function l(){return c}function h(){return"undefined"!=typeof navigator&&"ReactNative"===navigator?.product}function m(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?Boolean(process.env.FEDERATION_DEBUG):!("undefined"==typeof FEDERATION_DEBUG||!Boolean(FEDERATION_DEBUG))||function(){try{if(l()&&window.localStorage)return Boolean(localStorage.getItem(i))}catch(e){return!1}return!1}()}const u="[ Module Federation ]",d=console,f=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];var p=class{constructor(e,t=d){this.prefix=e,this.delegate=t??d}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??d}emit(e,t){const o=this.delegate,r=m()?function(){try{const e=(new Error).stack;if(!e)return;const[,...t]=e.split("\n"),o=t.filter((e=>!f.some((t=>e.includes(t)))));if(!o.length)return;return`Stack trace:\n${o.slice(0,5).join("\n")}`}catch{return}}():void 0,n=r?[...t,r]:t,s=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const e of s){const t=o[e];if("function"==typeof t)return void t.call(o,this.prefix,...n)}for(const e of s){const t=d[e];if("function"==typeof t)return void t.call(d,this.prefix,...n)}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){m()&&this.emit("debug",e)}};function y(e){return new p(e)}y(u),function(e){const t=new p(e);Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1})}(u);const g=(e,t,o,r)=>{const n=[`${[t[e]]} #${e}`];return o&&n.push(`args: ${JSON.stringify(o)}`),n.push((e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`)(e)),r&&n.push(`Original Error Message:\n ${r}`),n.join("\n")},E="[ Federation Runtime ]",b=y(E);function S(e,t,o,r,n){e||(void 0!==o?_(t,o,r,void 0):_(t))}function _(e,t,o,r,n){if(void 0!==t)return function(e,t,o,r,n){return(e=>{throw new Error(`${E}: ${e}`)})(g(e,t,o,n))}(e,t,o??{},0,r);const s=e;if(s instanceof Error)throw s.message.startsWith(E)||(s.message=`${E}: ${s.message}`),s;throw new Error(`${E}: ${s}`)}function w(e){e instanceof Error?(e.message.startsWith(E)||(e.message=`${E}: ${e.message}`),b.warn(e)):b.warn(e)}function I(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function v(e){return void 0!==e.entry}function $(e){return!e.entry.includes(".json")}function N(e){return e&&"object"==typeof e}const R=Object.prototype.toString;function k(e){return Array.isArray(e)?e:[e]}function O(e){const t={url:"",type:"global",globalName:""};return c||h()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}const T="object"==typeof globalThis?globalThis:window,A=(()=>{try{return document.defaultView}catch{return T}})(),x=A;function P(e,t,o){Object.defineProperty(e,t,{value:o,configurable:!1,writable:!0})}function M(e,t){return Object.hasOwnProperty.call(e,t)}M(T,"__GLOBAL_LOADING_REMOTE_ENTRY__")||P(T,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const L=T.__GLOBAL_LOADING_REMOTE_ENTRY__;function C(e){M(e,"__VMOK__")&&!M(e,"__FEDERATION__")&&P(e,"__FEDERATION__",e.__VMOK__),M(e,"__FEDERATION__")||(P(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),P(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__??=new Map}function j(e,t){if("string"==typeof t){if(e[t])return{value:e[t],key:t};{const o=Object.keys(e);for(const r of o){const[o,n]=r.split(":"),s=`${o}:${t}`,i=e[s];if(i)return{value:i,key:s}}return{value:void 0,key:t}}}_(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}C(T),C(A);const D=()=>A.__FEDERATION__.moduleInfo,H=e=>((e,t)=>{const o=j(t,I(e)).value;if(o&&!o.version&&"version"in e&&e.version&&(o.version=e.version),o)return o;if("version"in e&&e.version){const{version:t,...o}=e,r=I(o),n=j(A.__FEDERATION__.moduleInfo,r).value;if(n?.version===t)return n}})(e,A.__FEDERATION__.moduleInfo),F=(e,t)=>{const o=I(e);return A.__FEDERATION__.moduleInfo[o]=t,A.__FEDERATION__.moduleInfo},U=(e,t)=>{const o=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:o,entryExports:T[o]}},G=e=>T.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),B="default",V="global",W="[0-9A-Za-z-]+",q=`(?:\\+(${W}(?:\\.${W})*))`,z="0|[1-9]\\d*",K="[0-9]+",Z="\\d*[a-zA-Z-][a-zA-Z0-9-]*",J=`(?:${K}|${Z})`,Y=`(?:${z}|${Z})`,X=`(?:-(${Y}(?:\\.${Y})*))`,Q=`${z}|x|X|\\*`,ee=`[v=\\s]*(${Q})(?:\\.(${Q})(?:\\.(${Q})(?:${X})?${q}?)?)?`,te=`^\\s*(${ee})\\s+-\\s+(${ee})\\s*$`,oe="((?:<|>)?=?)",re=`(\\s*)${oe}\\s*([v=\\s]*(${K})\\.(${K})\\.(${K})(?:-?(${J}(?:\\.${J})*))?${q}?|${ee})`,ne="(?:~>?)",se=`(\\s*)${ne}\\s+`,ie="(?:\\^)",ae=`(\\s*)${ie}\\s+`,ce="(<|>)?=?\\s*\\*",le=`^${ie}${ee}$`,he=`^${ne}${ee}$`,me=`^${oe}\\s*${ee}$`,ue=`^${oe}\\s*(v?(${z})\\.(${z})\\.(${z})${X}?${q}?)$|^$`,de="^\\s*>=\\s*0.0.0\\s*$";function fe(e){return new RegExp(e)}function pe(e){return!e||"x"===e.toLowerCase()||"*"===e}function ye(...e){return t=>e.reduce(((e,t)=>t(e)),t)}function ge(e){return e.match(fe(ue))}function Ee(e,t,o,r){const n=`${e}.${t}.${o}`;return r?`${n}-${r}`:n}function be(e){return e.replace(fe(te),((e,t,o,r,n,s,i,a,c,l,h,m)=>`${t=pe(o)?"":pe(r)?`>=${o}.0.0`:pe(n)?`>=${o}.${r}.0`:`>=${t}`} ${a=pe(c)?"":pe(l)?`<${Number(c)+1}.0.0-0`:pe(h)?`<${c}.${Number(l)+1}.0-0`:m?`<=${c}.${l}.${h}-${m}`:`<=${a}`}`.trim()))}function Se(e){return e.replace(fe(re),"$1$2$3")}function _e(e){return e.replace(fe(se),"$1~")}function we(e){return e.replace(fe(ae),"$1^")}function Ie(e){return e.trim().split(/\s+/).map((e=>e.replace(fe(le),((e,t,o,r,n)=>pe(t)?"":pe(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:pe(r)?"0"===t?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.0 <${Number(t)+1}.0.0-0`:n?"0"===t?"0"===o?`>=${t}.${o}.${r}-${n} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r}-${n} <${Number(t)+1}.0.0-0`:"0"===t?"0"===o?`>=${t}.${o}.${r} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${Number(t)+1}.0.0-0`)))).join(" ")}function ve(e){return e.trim().split(/\s+/).map((e=>e.replace(fe(he),((e,t,o,r,n)=>pe(t)?"":pe(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:pe(r)?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:n?`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`)))).join(" ")}function $e(e){return e.split(/\s+/).map((e=>e.trim().replace(fe(me),((e,t,o,r,n,s)=>{const i=pe(o),a=i||pe(r),c=a||pe(n);return"="===t&&c&&(t=""),s="",i?">"===t||"<"===t?"<0.0.0-0":"*":t&&c?(a&&(r=0),n=0,">"===t?(t=">=",a?(o=Number(o)+1,r=0,n=0):(r=Number(r)+1,n=0)):"<="===t&&(t="<",a?o=Number(o)+1:r=Number(r)+1),"<"===t&&(s="-0"),`${t+o}.${r}.${n}${s}`):a?`>=${o}.0.0${s} <${Number(o)+1}.0.0-0`:c?`>=${o}.${r}.0${s} <${o}.${Number(r)+1}.0-0`:e})))).join(" ")}function Ne(e){return e.trim().replace(fe(ce),"")}function Re(e,t){return(e=Number(e)||e)>(t=Number(t)||t)?1:e===t?0:-1}function ke(e,t){return Re(e.major,t.major)||Re(e.minor,t.minor)||Re(e.patch,t.patch)||function(e,t){const{preRelease:o}=e,{preRelease:r}=t;if(void 0===o&&Boolean(r))return 1;if(Boolean(o)&&void 0===r)return-1;if(void 0===o&&void 0===r)return 0;for(let e=0,t=o.length;e<=t;e++){const t=o[e],n=r[e];if(t!==n)return void 0===t&&void 0===n?0:t?n?Re(t,n):-1:1}return 0}(e,t)}function Oe(e,t){return e.version===t.version}function Te(e,t){switch(e.operator){case"":case"=":return Oe(e,t);case">":return ke(e,t)<0;case">=":return Oe(e,t)||ke(e,t)<0;case"<":return ke(e,t)>0;case"<=":return Oe(e,t)||ke(e,t)>0;case void 0:return!0;default:return!1}}function Ae(e){return ye(Ie,ve,$e,Ne)(e)}function xe(e){return ye(be,Se,_e,we)(e.trim()).split(/\s+/).join(" ")}function Pe(e,t){if(!e)return!1;const o=ge(e);if(!o)return!1;const[,r,,n,s,i,a]=o,c={operator:r,version:Ee(n,s,i,a),major:n,minor:s,patch:i,preRelease:a?.split(".")},l=t.split("||");for(const e of l){const t=e.trim();if(!t)return!0;if("*"===t||"x"===t)return!0;try{const e=xe(t);if(!e.trim())return!0;const o=e.split(" ").map((e=>Ae(e))).join(" ");if(!o.trim())return!0;const r=o.split(/\s+/).map((e=>e.trim().replace(fe(de),""))).filter(Boolean);if(0===r.length)continue;let n=!0;for(const e of r){const t=ge(e);if(!t){n=!1;break}const[,o,,r,s,i,a]=t;if(!Te({operator:o,version:Ee(r,s,i,a),major:r,minor:s,patch:i,preRelease:a?.split(".")},c)){n=!1;break}}if(n)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}function Me(e,t){const o=t.shared||{},r=t.name,n=Object.keys(o).reduce(((e,n)=>{const s=k(o[n]);return e[n]=e[n]||[],s.forEach((o=>{e[n].push(function(e,t,o,r){let n;return n="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve((()=>{_(`Cannot get shared "${o}" from "${t}": neither "get" nor "lib" is provided in the share config.`)})),e.shareConfig?.eager&&e.treeShaking?.mode&&_(`Invalid shared config for "${o}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:n,loaded:!(!e?.loaded&&!("lib"in e))||void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??r)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??a.UNKNOWN,useIn:[]}:void 0}}(o,r,n,t.shareStrategy))})),e}),{}),s={...e.shared};return Object.keys(n).forEach((e=>{s[e]?n[e].forEach((t=>{s[e].find((e=>e.version===t.version))||s[e].push(t)})):s[e]=n[e]})),{allShareInfos:s,newShareInfos:n}}function Le(e,t){if(!e)return!1;const{status:o,mode:r}=e;return o!==a.NO_USE&&(o===a.CALCULATED||"runtime-infer"===r&&(!t||He(e,t)))}function Ce(e,t){const o=e=>{if(!Number.isNaN(Number(e))){const t=e.split(".");let o=e;for(let e=0;e<3-t.length;e++)o+=".0";return o}return e};return!!Pe(o(e),`<=${o(t)}`)}const je=(e,t)=>{const o=t||function(e,t){return Ce(e,t)};return Object.keys(e).reduce(((e,t)=>e?o(e,t)||"0"===e?t:e:t),0)},De=e=>Boolean(e.loaded)||"function"==typeof e.lib,He=(e,t)=>{if(!e||!t)return!1;const{usedExports:o}=e;return!!o&&!!t.every((e=>o.includes(e)))};function Fe(e,t,o,r){const n=e[t][o];let s="",i=Le(r);const a=function(e,t){return i?!n[e].treeShaking||!!n[t].treeShaking&&!De(n[e].treeShaking)&&Ce(e,t):!De(n[e])&&Ce(e,t)};if(i){if(s=je(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:je(e[t][o],a),useTreesShaking:i}}const Ue=e=>De(e)||(e=>Boolean(e.loading))(e);function Ge(e,t,o,r){const n=e[t][o];let s="",i=Le(r);const a=function(e,t){if(i){if(!n[e].treeShaking)return!0;if(!n[t].treeShaking)return!1;if(Ue(n[t].treeShaking))return!Ue(n[e].treeShaking)||Boolean(Ce(e,t));if(Ue(n[e].treeShaking))return!1}return Ue(n[t])?!Ue(n[e])||Boolean(Ce(e,t)):!Ue(n[e])&&Ce(e,t)};if(i){if(s=je(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:je(e[t][o],a),useTreesShaking:i}}function Be(e){return"loaded-first"===e?Ge:Fe}function Ve(e,t,o,r){if(!e)return;const{shareConfig:n,scope:s=B,strategy:i,treeShaking:a}=o,c=Array.isArray(s)?s:[s];for(const s of c)if(n&&e[s]&&e[s][t]){const{requiredVersion:c}=n,{version:l,useTreesShaking:h}=Be(i)(e,s,t,a),m=()=>{const r=e[s][t][l];if(n.singleton){if("string"==typeof c&&!Pe(l,c)){const e=`Version ${l} from ${l&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${c})`;n.strictVersion?_(e):w(e)}return{shared:r,useTreesShaking:h}}{if(!1===c||"*"===c)return{shared:r,useTreesShaking:h};if(Pe(l,c))return{shared:r,useTreesShaking:h};const o=Le(a);if(o)for(const[r,n]of Object.entries(e[s][t]))if(Le(n.treeShaking,a?.usedExports)&&Pe(r,c))return{shared:n,useTreesShaking:o};for(const[o,r]of Object.entries(e[s][t]))if(Pe(o,c))return{shared:r,useTreesShaking:!1}}},u={shareScopeMap:e,scope:s,pkgName:t,version:l,GlobalFederation:x.__FEDERATION__,shareInfo:o,resolver:m};return(r.emit(u)||u).resolver()}}function We(){return x.__FEDERATION__.__SHARE__}function qe(e){const{pkgName:t,extraOptions:o,shareInfos:r}=e,n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),s=(...e)=>{const t={};for(const o of e)if(o)for(const[e,r]of Object.entries(o)){const o=t[e];n(o)&&n(r)?t[e]=s(o,r):void 0!==r&&(t[e]=r)}return t};return s((o?.resolver??(e=>{if(!e)return;const t={};return e.forEach((e=>{t[e.version]=e})),t[je(t,(function(e,o){return!De(t[e])&&Ce(e,o)}))]}))(r[t]),o?.customShareInfo)}const ze=(e,t)=>{var o,r;e.useIn||(e.useIn=[]),o=e.useIn,r=t,-1===o.findIndex((e=>e===r))&&o.push(r)};function Ke(e,t){return t&&e.treeShaking?e.treeShaking:e}const Ze=function(...e){return e.length?e.reduce(((e,t)=>t?e?`${e}:${t}`:t:e),""):""};function Je(e,t){if("getPublicPath"in e){let o;return o=e.getPublicPath.startsWith("function")?new Function("return "+e.getPublicPath)()():new Function(e.getPublicPath)(),`${o}${t}`}return"publicPath"in e?l()||h()||!("ssrPublicPath"in e)||"string"!=typeof e.ssrPublicPath?`${e.publicPath}${t}`:`${e.ssrPublicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")}const Ye=e=>{console.warn(`[ Federation Runtime ]: ${e}`)};function Xe(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}async function Qe(e,t){try{return await e()}catch(e){return void(!t&&Ye(e))}}function et(e,t){const o=/^(https?:)?\/\//i;return e.replace(o,"").replace(/\/$/,"")===t.replace(o,"").replace(/\/$/,"")}function tt(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("script");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("src");if(i&&et(i,e.url)){o=n,r=!1;break}}if(!o){const t=e.attrs;let r;o=document.createElement("script"),o.type="module"===t?.type?"module":"text/javascript",e.createScriptHook&&(r=e.createScriptHook(e.url,e.attrs),r instanceof HTMLScriptElement?o=r:"object"==typeof r&&("script"in r&&r.script&&(o=r.script),"timeout"in r&&r.timeout&&(n=r.timeout))),o.src||(o.src=e.url),t&&!r&&Object.keys(t).forEach((e=>{o&&("async"===e||"defer"===e?o[e]=t[e]:o.getAttribute(e)||o.setAttribute(e,t[e]))}))}let i=null;const a="undefined"!=typeof window?t=>{if(t.filename&&et(t.filename,e.url)){const o=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);o.name="ScriptExecutionError",i=o}}:null;a&&window.addEventListener("error",a);const c=async(r,n)=>{clearTimeout(t),a&&window.removeEventListener("error",a);const s=()=>{if("error"===n?.type){const t=new Error(n?.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.)`);t.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else i?e?.onErrorCallback&&e?.onErrorCallback(i):e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,Qe((()=>{const{needDeleteScript:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r&&"function"==typeof r)){const e=r(n);if(e instanceof Promise){const t=await e;return s(),t}return s(),e}s()};return o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),t=setTimeout((()=>{c(null,{type:"error",isTimeout:!0})}),n),{script:o,needAttach:r}}const ot=new Map;function rt(e){if(!e)throw new Error("import specifier is required");if(ot.has(e))return ot.get(e);const t=new Function("name","return import(name)")(e).then((e=>e)).catch((t=>{throw console.error(`Error importing module ${e}:`,t),ot.delete(e),t}));return ot.set(e,t),t}const nt="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t,o,r)=>{if(r?.createScriptHook){const t=r.createScriptHook(e);t&&"object"==typeof t&&"url"in t&&(e=t.url)}let n;try{n=new URL(e)}catch(e){return console.error("Error constructing URL:",e),void t(new Error(`Invalid URL: ${e}`))}(async()=>r?.fetch?(e,t)=>(async(e,t,o)=>{const r=await((e,t)=>o.lifecycle.fetch.emit(e,t))(e,t||{});return r&&r instanceof Response?r:fetch(e,t||{})})(e,t,r):fetch)().then((async e=>{if("esm"===o?.type||"module"===o?.type)return ht(n.href,{fetch:e,vm:await rt("vm")}).then((async e=>{await e.evaluate(),t(void 0,e.namespace)})).catch((e=>{t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}));(async(e,r)=>{try{const n=await e(r.href),s=await n.text(),[i,a]=await Promise.all([rt("path"),rt("vm")]),c={exports:{},module:{exports:{}}},l=r.pathname.split("/").slice(0,-1).join("/"),h=i.basename(r.pathname),m=new a.Script(`(function(exports, module, require, __dirname, __filename) {${s}\n})`,{filename:h,importModuleDynamically:a.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??rt});let u;u=(await rt("node:module")).createRequire("file:"===r.protocol||"node:"===r.protocol?r.href:i.join(process.cwd(),"__mf_require_base__.js")),m.runInThisContext()(c.exports,c.module,u,l,h);const d=c.module.exports||c.exports;if(o&&d&&o.globalName)return void t(void 0,d[o.globalName]||d);t(void 0,d)}catch(e){t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}})(e,n)})).catch((e=>{t(e)}))}:(e,t,o,r)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},st="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise(((o,r)=>{nt(e,((e,n)=>{e?r(e):o(globalThis[t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`]=n)}),t.attrs,t.loaderHook)})):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},it=new Map,at=e=>e.startsWith("http:")||e.startsWith("https:"),ct=e=>!(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes(":"));async function lt(e,t,o){if(await async function(e){return!!e.startsWith("node:")||!!ct(e)&&(await rt("node:module")).builtinModules.includes(e)}(e))return async function(e,t){const o=`node-builtin:${e}`;return it.has(o)?it.get(o):async function(e,t,o){if("function"!=typeof o.SyntheticModule)throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const r=function(e){const t=!e||"object"!=typeof e&&"function"!=typeof e?{default:e}:e,o={...t};return Object.prototype.hasOwnProperty.call(o,"default")||(o.default=t),o}(t),n=Object.keys(r),s=new o.SyntheticModule(n,(function(){for(const e of n)this.setExport(e,r[e])}),{identifier:e});return it.set(e,s),await s.link((async()=>{throw new Error(`Node.js built-in module "${e}" should not request child modules.`)})),await s.evaluate(),s}(o,await rt(e),t)}(e,o.vm);if(ct(e))throw new Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);const r=new URL(e,t).href;if(!at(r))throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${r}". Only http(s) remote modules and Node.js built-in modules are supported.`);return ht(r,o)}async function ht(e,t){if(it.has(e))return it.get(e);const{fetch:o,vm:r}=t;if(!at(e))throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);const n=await(await o(e)).text(),s=(await rt("node:url")).pathToFileURL(process.cwd()).href,i=new r.SourceTextModule(n,{identifier:e,initializeImportMeta:t=>{t.url=function(e,t){const o=t.endsWith("/")?t:`${t}/`;return new URL(`__module_federation_remote__${function(e){const t=new URL(e),o=encodeURIComponent(t.protocol.slice(0,-1)),r=encodeURIComponent(t.host),n=t.pathname.split("/").map((e=>encodeURIComponent(e))).join("/"),s=encodeURIComponent(`${t.search}${t.hash}`);return`/${o}/${r}${n}${s?`/${s}`:""}`}(e)}`,o).href}(e,s)},importModuleDynamically:async o=>async function(e){if("linked"===e.status&&await e.evaluate(),"errored"===e.status)throw e.error;return e}(await lt(o,e,t))});return it.set(e,i),await i.link((async o=>lt(o,e,t))),i}const mt="RUNTIME-001",ut="RUNTIME-002",dt="RUNTIME-003",ft="RUNTIME-004",pt="RUNTIME-005",yt="RUNTIME-006",gt="RUNTIME-007",Et="RUNTIME-008",bt="RUNTIME-009",St="RUNTIME-010",_t="RUNTIME-011",wt="RUNTIME-012",It="RUNTIME-013",vt="RUNTIME-014",$t="RUNTIME-015",Nt={[mt]:"Failed to get remoteEntry exports.",[ut]:'The remote entry interface does not contain "init"',[dt]:"Failed to get manifest.",[ft]:"Failed to locate remote.",[pt]:"Invalid loadShareSync function call from bundler runtime",[yt]:"Invalid loadShareSync function call from runtime",[gt]:"Failed to get remote snapshot.",[Et]:"Failed to load script resources.",[bt]:"Please call createInstance first.",[St]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[_t]:"The remoteEntry URL is missing from the remote snapshot.",[wt]:'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.',[It]:"The manifest is not a valid Module Federation manifest.",[vt]:"The remote does not expose the requested module.",[$t]:"Remote container initialization failed."},Rt=".then(callbacks[0]).catch(callbacks[1])",kt=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function Ot(e){return"esm"===e||"module"===e}function Tt(e,t,o){const{remoteEntryKey:r,entryExports:n}=U(e,t);return n||_(mt,Nt,{remoteName:e,remoteEntryUrl:o,remoteEntryKey:r}),n}async function At({remoteInfo:e,remoteEntryExports:t,loaderHook:o,getEntryUrl:r,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return Ot(c)?async function({entry:e,remoteEntryExports:t,name:o,getEntryUrl:r}){return new Promise(((n,s)=>{const i=e=>{if((t=e)instanceof TypeError&&kt.some((e=>t.message.includes(e)))){const t=e instanceof Error?e.message:String(e);try{_(Et,Nt,{remoteName:o,resourceUrl:a},t)}catch(e){return void s(e)}}var t;s(e)},a=r?r(e):e;try{t?n(t):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?new Function("callbacks",`import("${a}")${Rt}`)([n,i]):import(a).then(n).catch(i)}catch(e){_(`Failed to load ESM entry from "${a}". ${e instanceof Error?e.message:String(e)}`)}}))}({entry:s,remoteEntryExports:t,name:a,getEntryUrl:r}):"system"===c?async function({entry:e,remoteEntryExports:t}){return new Promise(((o,r)=>{try{t?o(t):new Function("callbacks",`System.import("${e}")${Rt}`)([o,r])}catch(t){_(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}}))}({entry:s,remoteEntryExports:t}):async function({name:e,globalName:t,entry:o,remoteInfo:r,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=U(e,t);if(a)return a;const c=s?s(o):o;return function(e,t){const{attrs:o={},createScriptHook:r}=t;return new Promise(((t,n)=>{const{script:s,needAttach:i}=tt({url:e,cb:t,onErrorCallback:n,attrs:{fetchpriority:"high",...o},createScriptHook:r,needDeleteScript:!0});i&&document.head.appendChild(s)}))}(c,{attrs:{},createScriptHook:(e,t)=>{const o=n.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:i?{...i,url:e}:void 0});if(o)return o instanceof HTMLScriptElement||"script"in o||"timeout"in o?o:void 0}}).then((()=>Tt(e,t,o)),(t=>{const o=t instanceof Error?t.message:String(t);_(Et,Nt,{remoteName:e,resourceUrl:c},o)}))}({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:o,getEntryUrl:r,resourceContext:n})}function xt(e){const{entry:t,name:o}=e;return Ze(o,t)}async function Pt(e){const{origin:t,remoteEntryExports:o,remoteInfo:r,getEntryUrl:n,resourceContext:s,_inErrorHandling:i=!1}=e,a=xt(r);if(o)return o;if(!L[a]){const e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;L[a]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:o}).then((e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:c)?At({remoteInfo:r,remoteEntryExports:o,loaderHook:l,getEntryUrl:n,resourceContext:s}):async function({remoteInfo:e,loaderHook:t,resourceContext:o}){const{entry:r,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=U(s,n);return a||st(r,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(r,n={})=>{const s=t.lifecycle.createScript.emit({url:r,attrs:n,remoteInfo:e,resourceContext:o?{...o,url:r}:void 0});if(s)return"url"in s?s:void 0}}}).then((()=>Tt(s,n,r))).catch((e=>{_(`Failed to load Node.js entry for remote "${s}" from "${r}". ${e instanceof Error?e.message:String(e)}`)}))}({remoteInfo:r,loaderHook:l,resourceContext:s})))).then((async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e))).catch((async e=>{const n=xt(r),s=e instanceof Error&&e.message.includes("ScriptExecutionError");if(e instanceof Error&&e.message.includes(Et)&&!s&&!i){const e=e=>Pt({...e,_inErrorHandling:!0}),s=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e,origin:t,remoteInfo:r,remoteEntryExports:o,globalLoading:L,uniqueKey:n});if(s)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:s,recovered:!0}),s}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e}))}return L[a]}function Mt(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||V,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||B}}function Lt(e,t){return t&&"."!==t?`${e}/${t.replace(/^\.\//,"")}`:e}function Ct(e,t){for(const o of e){const e=t.startsWith(o.name);let r=t.replace(o.name,"");if(e){if(r.startsWith("/"))return r=`.${r}`,{pkgNameOrAlias:o.name,expose:r,remote:o};if(""===r)return{pkgNameOrAlias:o.name,expose:".",remote:o}}const n=o.alias&&t.startsWith(o.alias);let s=o.alias&&t.replace(o.alias,"");if(o.alias&&n){if(s&&s.startsWith("/"))return s=`.${s}`,{pkgNameOrAlias:o.alias,expose:s,remote:o};if(""===s)return{pkgNameOrAlias:o.alias,expose:".",remote:o}}}}function jt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Dt(e){return e instanceof Error&&(e.message.includes("timed out")||e.name.includes("Timeout"))}function Ht(e,t,o,r){return{url:t,status:o,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}function Ft({host:e,remoteInfo:t,url:o,attrs:r,context:n,needDeleteLink:s}){return new Promise((i=>{const{link:a,needAttach:c}=function(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("link");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("href"),a=n.getAttribute("rel");if(i&&et(i,e.url)&&a===e.attrs.rel){o=n,r=!1;break}}if(!o){let t;o=document.createElement("link"),o.setAttribute("href",e.url);let r=!0;const s=e.attrs;e.createLinkHook&&(t=e.createLinkHook(e.url,s),t instanceof HTMLLinkElement?(o=t,r=!1):"object"==typeof t&&("link"in t&&t.link&&(o=t.link,r=!1),"timeout"in t&&t.timeout&&(n=t.timeout))),s&&r&&Object.keys(s).forEach((e=>{o&&!o.getAttribute(e)&&o.setAttribute(e,s[e])}))}if(!r)return Promise.resolve().then((()=>{e?.cb&&e?.cb()})),{link:o,needAttach:r};const i=(r,n)=>{t&&clearTimeout(t);const s=()=>{if("error"===n?.type){const t=new Error(n?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,Qe((()=>{const{needDeleteLink:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r)){const e=r(n);return s(),e}s()};return o.onerror=i.bind(null,o.onerror),o.onload=i.bind(null,o.onload),t=setTimeout((()=>{i(null,{type:"error",isTimeout:!0})}),n),{link:o,needAttach:r}}({url:o,cb:()=>{i(Ht(n,o,c?"success":"cached"))},onErrorCallback:e=>{i(Ht(n,o,Dt(e)?"timeout":"error",e))},attrs:r,createLinkHook:(o,r)=>{const s=e.loaderHook.lifecycle.createLink.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLLinkElement,s},needDeleteLink:s});c&&document.head.appendChild(a)}))}function Ut({host:e,remoteInfo:t,url:o,attrs:r,context:n}){return new Promise((s=>{const{script:i,needAttach:a}=tt({url:o,cb:()=>{s(Ht(n,o,a?"success":"cached"))},onErrorCallback:e=>{s(Ht(n,o,Dt(e)?"timeout":"error",e))},attrs:r,createScriptHook:(o,r)=>{const s=e.loaderHook.lifecycle.createScript.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLScriptElement,s},needDeleteScript:!0});a&&document.head.appendChild(i)}))}function Gt(e,t){return{...e,resourceType:t}}function Bt(e,t,o,r=!0,n={initiator:"preloadRemote",id:e.name}){const{cssAssets:s,jsAssetsWithoutEntry:i,entryAssets:a}=o,c=[];if(t.options.inBrowser){if(a.forEach((e=>{const{moduleInfo:o}=e;c.push(async function(e,t,o,r){const n=e.moduleCache.get(o.name),s=o.entry;if(n?.remoteEntryExports)return Ht(r,s,"cached");try{if(!await Pt({origin:e,remoteInfo:o,remoteEntryExports:n?.remoteEntryExports,resourceContext:{...r,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return Ht(r,s,"success")}catch(e){return Ht(r,s,Dt(e)?"timeout":"error",e)}}(t,0,o,Gt(n,"remoteEntry")))})),r){const o={rel:"preload",as:"style"};s.forEach((r=>{c.push(Ft({host:t,remoteInfo:e,url:r,attrs:o,context:Gt(n,"css")}))}))}else{const o={rel:"stylesheet",type:"text/css"};s.forEach((r=>{c.push(Ft({host:t,remoteInfo:e,url:r,attrs:o,needDeleteLink:!1,context:Gt(n,"css")}))}))}let o=Ut,l={fetchpriority:"high",type:"text/javascript"};r?(o=Ft,l={rel:"preload",as:"script"}):Ot(e.type)&&(o=Ft,l={rel:"modulepreload",fetchpriority:"high"}),i.forEach((r=>{c.push(o({host:t,remoteInfo:e,url:r,attrs:l,context:Gt(n,"js")}))}))}return Promise.all(c)}function Vt(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function Wt(e){const t={};for(const[o,r]of Object.entries(e.shared)){const e=r[0];e&&(t[o]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:!1!==e.shareConfig?.requiredVersion&&e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(Vt)??[],shared:t}}}function qt(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map((e=>e.moduleName)).filter(Boolean);return t.length?t.join(","):void 0}var zt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await Pt({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:Lt(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return S(t,`remoteEntryExports is undefined \n ${Xe(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,o,r){const n=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host}),n;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,cached:!0,origin:this.host}),o}return n}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:r,shareScope:s,initScope:i}=function(e,t,o){const r=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach((e=>{r[e]||(r[e]={})}));const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:r[n[0]],initScope:o??[]}}(this.remoteInfo,this.host.shareScopeMap,o),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:r,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});void 0===n?.init&&_(ut,Nt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Wt(this.host.options));try{await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions)}catch(e){_($t,Nt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,Wt(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,origin:this.host}),o}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,o,r){const{loadFactory:n=!0}=o||{loadFactory:!0},s=await this.init(e,r,void 0,t);let i;this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});try{const o=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i="function"==typeof o?o:void 0,i||(i=await s.get(t)),i||_(vt,Nt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:qt(r)},void 0,Wt(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,moduleFactory:i,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:o,origin:this.host}),o}const a=((e,t)=>{let o;return o=e.endsWith("/")?e.slice(0,-1):e,t.startsWith(".")&&(t=t.slice(1)),o+=t,o})(this.remoteInfo.name,t),c=this.wraperFactory(i,a);if(!n)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,origin:this.host});try{const o=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:o,origin:this.host}),o}catch(o){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:o,origin:this.host}),o}}wraperFactory(e,t){function o(e,t){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:t,enumerable:!1})}return()=>{const r=e();return r instanceof Promise?r.then((e=>(o(e,t),e))):(o(r,t),r)}}},Kt=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var o;S((o=e,"[object Object]"===R.call(o)),"Plugin configuration is invalid.");const r=e.name;S(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach((t=>{const o=e[t];o&&this.lifecycle[t].on(o)})))}removePlugin(e){S(e,"A name is required.");const t=this.registerPlugins[e];S(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach((e=>{"name"!==e&&this.lifecycle[e].remove(t[e])}))}},Zt=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){"function"==typeof e&&this.listeners.add(e)}once(e){const t=this;this.on((function o(...r){return t.remove(o),e.apply(null,r)}))}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach((o=>{const r=o(...e);void 0!==r&&(t=r)})),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}};function Jt(e,t){if(!N(t))return!1;if(e!==t)for(const o in e)if(!(o in t))return!1;return!0}var Yt=class extends Zt{constructor(e){super(),this.onerror=_,this.type=e}emit(e){N(e)||_(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const o=t(e);if(void 0===o)continue;if(!Jt(e,o)){this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}e=o}catch(e){w(e),this.onerror(e)}return e}},Xt=class extends Zt{constructor(e){super(),this.onerror=_,this.type=e}emit(e){N(e)||_(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let o=0;const r=t=>(w(t),this.onerror(t),e),n=s=>{if(void 0!==s&&Jt(e,s))e=s;else if(void 0!==s)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(o<t.length)try{return Promise.resolve(t[o++](e)).then(n,r)}catch(e){return r(e)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const Qt="Remote loading is disabled by experiments.optimization.disableRemote.";var eo=class{constructor(){this.hooks=new Kt({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(Qt)}preloadRemote(){throw new Error(Qt)}registerRemotes(){throw new Error(Qt)}getRemoteModuleAndOptions(){throw new Error(Qt)}initRawContainer(){throw new Error(Qt)}},to=class extends Zt{emit(...e){let t;const o=Array.from(this.listeners);if(o.length>0){let r=0;const n=t=>!1!==t&&(r<o.length?Promise.resolve(o[r++].apply(null,e)).then((o=>void 0===o||1===e.length&&o===e[0]?n(t):n(o))):t);t=n()}return Promise.resolve(t)}};function oo(e,t){const o=O(t);o.url||_(_t,Nt,{remoteName:e.name});let r=Je(t,o.url);c||r.startsWith("http")||(r=`https:${r}`),e.type=o.type,e.entryGlobalName=o.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}const ro=(e,t)=>{if(!e)return t;const o=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){const t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return o?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:t};function no(e){return!(!("remoteEntry"in e)||!e.remoteEntry.includes(s))}function so(e){const t=e.split(":");return 1===t.length?{name:t[0],version:void 0}:2===t.length?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function io(e,t,o,r,n={},s){const{value:i}=j(e,I(t)),a=s||i;if(a&&!no(a)&&(o(a,t,r),a.remotesInfo)){const t=Object.keys(a.remotesInfo);for(const r of t){if(n[r])continue;n[r]=!0;const t=so(r),s=a.remotesInfo[r];io(e,{name:t.name,version:s.matchedVersion},o,!1,n,void 0)}}}const ao=(e,t)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${t}"]`);function co(e,t,o,r,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:h}=e,{preloadConfig:m}=t,{depsRemote:u}=m;if(io(r,o,((t,o,r)=>{let n;if(r)n=m;else if(Array.isArray(u)){const e=u.find((e=>e.nameOrAlias===o.name||e.nameOrAlias===o.alias));if(!e)return;n=jt(e)}else{if(!0!==u)return;n=m}const c=Je(t,O(t).url);c&&a.push({name:o.name,moduleInfo:{name:o.name,entry:c,type:"remoteEntryType"in t?t.remoteEntryType:"global",entryGlobalName:"globalName"in t?t.globalName:o.name,shareScope:"",version:"version"in t?t.version:void 0},url:c});let l="modules"in t?t.modules:[];const h=(d=n.exposes)?d.map((e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e)):[];var d,f;function p(e){const o=e.map((e=>Je(t,e)));return n.filter?o.filter(n.filter):o}if(h.length&&"modules"in t&&(l=t?.modules?.reduce(((e,t)=>(-1!==h?.indexOf(t.moduleName)&&e.push(t),e)),[])),l){const r=l.length;for(let a=0;a<r;a++){const r=l[a],c=`${o.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===r.moduleName?o.name:c,name:o.name,remoteSnapshot:t,preloadConfig:n,remote:o,origin:e}),f=c,T.__FEDERATION__.__PRELOADED_MAP__.get(f)||("all"===n.resourceCategory?(s.push(...p(r.assets.css.async)),s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.async)),i.push(...p(r.assets.js.sync))):"sync"===n.resourceCategory&&(s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.sync))),G(c))}}}),!0,{},n),n.shared&&n.shared.length>0){const t=(t,o)=>{const{shared:r}=Ve(e.shareScopeMap,o.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&"function"==typeof r.lib&&(o.assets.js.sync.forEach((e=>{c.add(e)})),o.assets.css.sync.forEach((e=>{l.add(e)})))};n.shared.forEach((e=>{const o=h.shared?.[e.sharedName];if(!o)return;const r=e.version?o.find((t=>t.version===e.version)):o;r&&k(r).forEach((o=>{t(o,e)}))}))}const d=i.filter((e=>!c.has(e)&&!ao("script",e)));return{cssAssets:s.filter((e=>!l.has(e)&&!ao("link",e))),jsAssetsWithoutEntry:d,entryAssets:a.filter((e=>!ao("script",e.url)))}}function lo(e,t){const o=H({name:t.name,version:t.options.version}),r=o&&"remotesInfo"in o&&o.remotesInfo&&j(o.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:o,globalSnapshot:D(),remoteSnapshot:H({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:D(),remoteSnapshot:H({name:e.name,version:"version"in e?e.version:void 0})}}var ho=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new Kt({beforeLoadRemoteSnapshot:new to("beforeLoadRemoteSnapshot"),loadSnapshot:new Xt("loadGlobalSnapshot"),loadRemoteSnapshot:new Xt("loadRemoteSnapshot"),afterLoadSnapshot:new Xt("afterLoadSnapshot")}),this.manifestLoading=x.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:o="loadRemote"}){const{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let n=H({name:this.HostInstance.options.name,version:this.HostInstance.options.version});var s;n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},s={[this.HostInstance.options.name]:n},A.__FEDERATION__.moduleInfo={...A.__FEDERATION__.moduleInfo,...s}),n&&"remotesInfo"in n&&!j(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:i,remoteSnapshot:a,globalSnapshot:l}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:m}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:i,remoteSnapshot:a,globalSnapshot:l});let u,d;if(h)if(no(h)){const r=c?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",n=await this.loadManifestSnapshot(r,e,{},{initiator:o,id:t||e.name});u=n,d=F({...e,entry:r},n)}else{const{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});u=t,d=m}else if(v(e)){const r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:o,id:t||e.name});u=r,d=F(e,r)}else _(gt,Nt,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(m)},void 0,Wt(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:d}}getGlobalRemoteInfo(e){return lo(e,this.HostInstance)}async getManifestJson(e,t,o,r){return(async()=>{const o=Mt(t);let n=this.manifestCache.get(e);if(n)return n;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},o,r?{...r,url:e,resourceType:"manifest"}:void 0);t&&t instanceof Response||(t=await fetch(e,{})),n=await t.json()}catch(r){n=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),n||(delete this.manifestLoading[e],_(dt,Nt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,Wt(this.HostInstance.options)))}const s=[!n.metaData&&"metaData",!n.exposes&&"exposes",!n.shared&&"shared"].filter(Boolean);return s.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${s.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),s.length>0&&_(It,Nt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:s.join(",")},void 0,Wt(this.HostInstance.options)),this.manifestCache.set(e,n),n})()}async loadManifestSnapshot(e,t,o,r){return this.manifestLoading[e]||(this.manifestLoading[e]=(async()=>{const n=await this.getManifestJson(e,t,o,r),s=function(e,t={}){const{remotes:o={},overrides:r={},version:n}=t;let s;const i=()=>"publicPath"in e.metaData?"auto"!==e.metaData.publicPath&&""!==e.metaData.publicPath||!n?e.metaData.publicPath:n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"):e.metaData.getPublicPath,a=Object.keys(r);let c={};Object.keys(o).length||(c=e.remotes?.reduce(((e,t)=>{let o;const n=t.federationContainerName;return o=a.includes(n)?r[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:o},e}),{})||{}),Object.keys(o).forEach((e=>c[e]={matchedVersion:a.includes(e)?r[e]:o[e]}));const{remoteEntry:{path:l,name:h,type:m},types:u={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:d},globalName:f,ssrRemoteEntry:p}=e.metaData,{exposes:y}=e;let g={version:n||"",buildVersion:d,globalName:f,remoteEntry:ro(l,h),remoteEntryType:m,remoteTypes:ro(u.path,u.name),remoteTypesZip:u.zip||"",remoteTypesAPI:u.api||"",remotesInfo:c,shared:e?.shared.map((e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]}))),modules:y?.map((e=>({moduleName:e.name,modulePath:e.path,assets:e.assets})))};if("publicPath"in e.metaData?(s={...g,publicPath:i()},"string"==typeof e.metaData.ssrPublicPath&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...g,getPublicPath:i()},p){const e=ro(p.path,p.name);s.ssrRemoteEntry=e,s.ssrRemoteEntryType=p.type||"commonjs-module"}return s}(n,{version:e}),{remoteSnapshot:i}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:n,remoteSnapshot:s,manifestUrl:e,from:"manifest"});return i})().then((e=>e))),this.manifestLoading[e]}},mo=class{constructor(){this.hooks=new Kt({})}},uo=class{constructor(e){this.hooks=new Kt({beforeRegisterShare:new Yt("beforeRegisterShare"),afterResolve:new Xt("afterResolve"),beforeLoadShare:new Xt("beforeLoadShare"),loadShare:new to,afterLoadShare:new Zt("afterLoadShare"),errorLoadShare:new Zt("errorLoadShare"),resolveShare:new Yt("resolveShare"),initContainerShareScopeMap:new Yt("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:o,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:o,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){w(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:o,error:r,recovered:n}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:n})}catch(e){w(e)}}registerShared(e,t){const{newShareInfos:o,allShareInfos:r}=Me(e,t);return Object.keys(o).forEach((e=>{o[e].forEach((o=>{o.scope.forEach((r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:o}),this.shareScopeMap[r]?.[e]||this.setShared({pkgName:e,lib:o.lib,get:o.get,loaded:o.loaded||Boolean(o.lib),shared:o,from:t.name})}))}))})),{newShareInfos:o,allShareInfos:r}}async loadShare(e,t){const{host:o}=this,r=qe({pkgName:e,extraOptions:t,shareInfos:o.options.shared});let n=r;try{r?.scope&&await Promise.all(r.scope.map((async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))}))),n=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:o.options.shared,origin:o})).shareInfo,S(n,`Cannot find shared "${e}" in host "${o.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const s=n,{shared:i,useTreesShaking:a}=Ve(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(i){const t=Ke(i,a);if(t.lib)return ze(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),t.lib;if(t.loading&&!t.loaded){const r=await t.loading;return t.loaded=!0,t.lib||(t.lib=r),ze(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),r}{const r=async()=>{const e=await t.get();return ze(t,o.options.name),t.loaded=!0,t.lib=e,e},n=r();this.setShared({pkgName:e,loaded:!1,shared:i,from:o.options.name,lib:null,loading:n,treeShaking:a?t:void 0});const c=await n;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),c}}{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,recovered:!0}),!1;const r=Le(s.treeShaking),n=Ke(s,r),i=async()=>{const t=await n.get();n.lib=t,n.loaded=!0,ze(n,o.options.name);const{shared:r,useTreesShaking:i}=Ve(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(r){const e=Ke(r,i);e.lib=t,e.loaded=!0,r.from=s.from}return t},a=i();this.setShared({pkgName:e,loaded:!1,shared:s,from:o.options.name,lib:null,loading:a,treeShaking:r?n:void 0});const c=await a;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:s}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:n,error:t}),t}}initializeSharing(e=B,t){const{host:o}=this,r=t?.from,n=t?.strategy;let s=t?.initScope;const i=[];if("build"!==r){const{initTokens:t}=this;s||(s=[]);let o=t[e];if(o||(o=t[e]={from:this.host.name}),s.indexOf(o)>=0)return i;s.push(o)}const a=this.shareScopeMap,c=o.options.name;a[e]||(a[e]={});const l=a[e];return Object.keys(o.options.shared).forEach((t=>{o.options.shared[t].forEach((o=>{o.scope.includes(e)&&((e,t)=>{const{version:o,eager:r}=t;l[e]=l[e]||{};const n=l[e],s=n[o]&&Ke(n[o]),i=Boolean(s&&("eager"in s&&s.eager||"shareConfig"in s&&s.shareConfig?.eager));(!s||"loaded-first"!==s.strategy&&!s.loaded&&(Boolean(!r)!==!i?r:c>n[o].from))&&(n[o]=t)})(t,o)}))})),"version-first"!==o.options.shareStrategy&&"version-first"!==n||o.options.remotes.forEach((t=>{t.shareScope===e&&i.push((async e=>{const{module:t}=await o.remoteHandler.getRemoteModuleAndOptions({id:e});let r;try{r=await t.getEntry()}catch(n){if(r=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"beforeLoadShare",remote:t.remoteInfo,origin:o}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,s))}})(t.name))})),i}loadShareSync(e,t){const{host:o}=this,r=qe({pkgName:e,extraOptions:t,shareInfos:o.options.shared});try{r?.scope&&r.scope.forEach((e=>{this.initializeSharing(e,{strategy:r.strategy})}));const{shared:n}=Ve(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(n){if("function"==typeof n.lib)return ze(n,o.options.name),n.loaded||(n.loaded=!0,n.from===o.options.name&&(r.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),n.lib;if("function"==typeof n.get){const t=n.get();if(!(t instanceof Promise))return ze(n,o.options.name),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:t,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),t}}if(r.lib)return r.loaded||(r.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib;if(r.get){const n=r.get();return n instanceof Promise&&_("build"===t?.from?pt:yt,Nt,{hostName:o.options.name,sharedPkgName:e},void 0,Wt(o.options)),r.lib=n,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:r.lib,shared:r}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib}_(yt,Nt,{hostName:o.options.name,sharedPkgName:e},void 0,Wt(o.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,error:t}),t}}initShareScopeMap(e,t,o={}){const{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:o,lib:r,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...h}=t;(Array.isArray(l)?l:[l]).forEach((t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][c]||(this.shareScopeMap[t][e][c]={version:c,scope:[t],...h,lib:r});const l=this.shareScopeMap[t][e][c];(e=>{const t=(e,t,o)=>{o&&!e[t]&&(e[t]=o)},o=a?e.treeShaking:e;t(o,"loaded",s),t(o,"loading",n),t(o,"get",i)})(l),o&&l.from!==o&&(l.from=o)}))}_setGlobalShareScopeMap(e){const t=We(),o=e.id||e.name;o&&!t[o]&&(t[o]=this.shareScopeMap)}},fo=class{constructor(){this.shareScopeMap={},this.hooks=new Kt({afterResolve:new Xt("afterResolve")})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}loadShareSync(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},po=class{constructor(e){this.hooks=new Kt({beforeRegisterRemote:new Yt("beforeRegisterRemote"),registerRemote:new Yt("registerRemote"),beforeRequest:new Xt("beforeRequest"),afterMatchRemote:new to("afterMatchRemote"),onLoad:new to("onLoad"),afterLoadRemote:new to("afterLoadRemote"),handlePreloadModule:new Zt("handlePreloadModule"),errorLoadRemote:new to("errorLoadRemote"),beforePreloadRemote:new to("beforePreloadRemote"),generatePreloadAssets:new to("generatePreloadAssets"),afterPreloadRemote:new to("afterPreloadRemote"),loadEntry:new to}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce(((e,t)=>(this.registerRemote(t,e,{force:!1}),e)),e.remotes)}setIdToRemoteMap(e,t){const{remote:o,expose:r}=t,{name:n,alias:s}=o;if(this.idToRemoteMap[e]={name:o.name,expose:r},s&&e.startsWith(n)){const t=e.replace(n,s);this.idToRemoteMap[t]={name:o.name,expose:r}}else if(s&&e.startsWith(s)){const t=e.replace(s,n);this.idToRemoteMap[t]={name:o.name,expose:r}}}async loadRemote(e,t){const{host:o}=this,r=Ct(o.options.remotes,e);let n,s=e,i=r?.expose,a=r?Mt(r.remote):void 0;try{const{loadFactory:r=!0}=t||{loadFactory:!0},{module:c,moduleOptions:l,remoteMatchInfo:h}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:m,remote:u,expose:d,id:f,remoteSnapshot:p}=h;s=f,i=d,a=Mt(u);const y=await c.get(f,d,t,p),g=await this.hooks.lifecycle.onLoad.emit({id:f,pkgNameOrAlias:m,expose:d,exposeModule:r?y:void 0,exposeModuleFactory:r?void 0:y,remote:u,options:l,moduleInstance:c,origin:o});return this.setIdToRemoteMap(e,h),n={id:s,expose:i,remote:a,options:t,origin:o},"function"==typeof g?g:y}catch(r){const{from:c="runtime"}=t||{from:"runtime"};let l;try{l=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:c,lifecycle:"onLoad",expose:i,remote:a,origin:o})}catch(e){throw n={id:s,expose:i,remote:a,options:t,error:e,origin:o},e}if(!l)throw n={id:s,expose:i,remote:a,options:t,error:r,origin:o},r;return n={id:s,expose:i,remote:a,options:t,error:r,origin:o,recovered:!0},l}finally{n&&await this.hooks.lifecycle.afterLoadRemote.emit(n)}}async preloadRemote(e){const{host:t}=this,o=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=(n=t.options.remotes,e.map((e=>{const t=function(e,t){for(const o of e){if(t===o.name)return o;if(o.alias&&t===o.alias)return o}}(n,e.nameOrAlias);return S(t,`Unable to preload ${e.nameOrAlias} as it is not included in ${!t&&Xe({remoteInfo:t,remotes:n})}`),{remote:t,preloadConfig:jt(e)}})));var n;let s;await Promise.all(r.flatMap((e=>{const{preloadConfig:t,remote:o}=e,r=t.exposes||[];return r.length?r.map((r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:Lt(o.name,r)}))):[{ops:e,id:`${o.name}/*`}]})).map((async e=>{const{ops:r,id:n}=e,{remote:s,preloadConfig:i}=r,a=Mt(s);try{const{globalSnapshot:e,remoteSnapshot:c}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:s,id:n,initiator:"preloadRemote"}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:s,remoteInfo:a,globalSnapshot:e,remoteSnapshot:c});if(!l)return;const h=await Bt(a,t,l,!0,{initiator:"preloadRemote",id:n});o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:h})}catch(e){o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:[{url:a.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(a.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:n,error:e}]})}})));const i=o.flatMap((e=>e.results.filter((e=>"error"===e.status||"timeout"===e.status))));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:o,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:o,error:s}),s)throw s}registerRemotes(e,t){const{host:o}=this;e.forEach((e=>{this.registerRemote(e,o.options.remotes,{force:t?.force})}))}initRawContainer(e,t,o){const{host:r}=this,n=new zt({host:r,remoteInfo:Mt({name:e,entry:t})});return n.remoteEntryExports=o,r.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:o}=e;let r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:t.options,origin:t,from:"runtime",error:e,lifecycle:"beforeRequest"}),!r)throw e}const{id:n}=r,s=Ct(t.options.remotes,n);if(!s)try{_(ft,Nt,{hostName:t.options.name,requestId:n},void 0,Wt(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:e,origin:t}),e}const{remote:i}=s,a=Mt(i);await this.hooks.lifecycle.afterMatchRemote.emit({id:n,...s,options:t.options,remoteInfo:a,origin:t});const c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:n,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:h}=c;S(l&&h,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let m=t.moduleCache.get(l.name);const u={host:t,remoteInfo:a};return m||(m=new zt(u),t.moduleCache.set(l.name,m)),{module:m,moduleOptions:u,remoteMatchInfo:c}}registerRemote(e,t,o){const{host:r}=this,n=()=>{if(e.alias){const o=t.find((t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias))));S(!o,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${o&&o.name} name or alias`)}"entry"in e&&c&&"undefined"!=typeof window&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=B),e.type||(e.type=V)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});const s=t.find((t=>t.name===e.name));if(s){const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o?.force&&(this.removeRemote(s),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),Ye(i.join(" ")))}else n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r})}removeRemote(e){try{const{host:t}=this,{name:o}=e,r=t.options.remotes.findIndex((e=>e.name===o));-1!==r&&t.options.remotes.splice(r,1);const n=j(T.__FEDERATION__.moduleInfo,I(e)).key;delete T.__FEDERATION__.moduleInfo[n],"entry"in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete x.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:s}=lo(e,t);if(s){const t=s&&"remotesInfo"in s&&s.remotesInfo&&j(s.remotesInfo,e.name).key;t&&delete s.remotesInfo[t]}const i=t.moduleCache.get(e.name);if(i){const o=i.remoteInfo,r=o.entryGlobalName;T[r]&&(Object.getOwnPropertyDescriptor(T,r)?.configurable?delete T[r]:T[r]=void 0);const n=xt(i.remoteInfo);L[n]&&delete L[n];let s=o.buildVersion?Ze(o.name,o.buildVersion):o.name;const a=T.__FEDERATION__.__INSTANCES__.findIndex((e=>o.buildVersion?e.options.id===s:e.name===s));if(-1!==a){const e=T.__FEDERATION__.__INSTANCES__[a];s=e.options.id||s;const t=We();let r=!0;const n=[];Object.keys(t).forEach((e=>{const s=t[e];s&&Object.keys(s).forEach((t=>{const i=s[t];i&&Object.keys(i).forEach((s=>{const a=i[s];a&&Object.keys(a).forEach((i=>{const c=a[i];c&&"object"==typeof c&&c.from===o.name&&(c.loaded||c.loading?(c.useIn=c.useIn.filter((e=>e!==o.name)),c.useIn.length?r=!1:n.push([e,t,s,i])):n.push([e,t,s,i]))}))}))}))})),r&&(e.shareScopeMap={},delete t[s]),n.forEach((([e,o,r,n])=>{delete t[e]?.[o]?.[r]?.[n]})),T.__FEDERATION__.__INSTANCES__.splice(a,1)}t.moduleCache.delete(e.name)}}catch(e){b.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}};const yo="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,go="boolean"!=typeof FEDERATION_OPTIMIZE_NO_REMOTE||!FEDERATION_OPTIMIZE_NO_REMOTE,Eo="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SHARED||!FEDERATION_OPTIMIZE_NO_SHARED;var bo=class{constructor(e){this.hooks=new Kt({beforeInit:new Yt("beforeInit"),init:new Zt,beforeInitContainer:new Xt("beforeInitContainer"),initContainer:new Xt("initContainer")}),this.version="2.8.2",this.moduleCache=new Map,this.loaderHook=new Kt({getModuleInfo:new Zt,createScript:new Zt,createLink:new Zt,fetch:new to,loadEntryError:new to,afterLoadEntry:new to("afterLoadEntry"),beforeInitRemote:new to("beforeInitRemote"),afterInitRemote:new to("afterInitRemote"),beforeGetExpose:new to("beforeGetExpose"),afterGetExpose:new to("afterGetExpose"),beforeExecuteFactory:new to("beforeExecuteFactory"),afterExecuteFactory:new to("afterExecuteFactory"),getModuleFactory:new to}),this.bridgeHook=new Kt({beforeBridgeRender:new Zt,afterBridgeRender:new Zt,beforeBridgeDestroy:new Zt,afterBridgeDestroy:new Zt});const t=go&&yo?[{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:o,expose:r,origin:n,remoteInfo:s,id:i}=e;if(!v(t)||!$(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:Lt(t.name,r)});oo(s,a);const l={remote:t,preloadConfig:{nameOrAlias:o,exposes:[r],resourceCategory:"sync",share:!1,depsRemote:!1}},h=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});return h&&Bt(s,n,h,!1,{initiator:"loadRemote",id:i}).catch((()=>{})),{...e,remoteSnapshot:a}}return e}},{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:o,remoteInfo:r,remote:n,globalSnapshot:s,remoteSnapshot:i}=e;return c?v(n)&&$(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:r.name,entry:n.entry,type:r.type||"global",entryGlobalName:"",shareScope:""}}]}:(oo(r,i),co(t,o,r,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}]:[],o={id:"undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"",name:e.name,plugins:t,remotes:[],shared:{},inBrowser:c};this.name=e.name,this.options=o,this.snapshotHandler=go?new ho(this):new mo,this.sharedHandler=Eo?new uo(this):new fo,this.remoteHandler=go?new po(this):new eo,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}initOptions(e){e.name&&e.name!==this.options.name&&_(g(St,Nt)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=B,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,o){return this.remoteHandler.initRawContainer(e,t,o)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,o={}){this.sharedHandler.initShareScopeMap(e,t,o)}formatOptions(e,t){const o=Eo?Me(e,t).allShareInfos:{},{userOptions:r,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:o}),s=this.remoteHandler.formatAndRegisterRemote(n,r),{allShareInfos:i}=this.sharedHandler.registerShared(n,r),a=[...n.plugins];r.plugins&&r.plugins.forEach((e=>{a.includes(e)||a.push(e)}));const c={...e,...t,plugins:a,remotes:s,shared:i,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const t=function(e,t){const o=A.__FEDERATION__.__GLOBAL_PLUGIN__,r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return o.length>0&&o.forEach((t=>{e?.find((e=>e.name!==t.name))&&e.push(t)})),e&&e.length>0&&e.forEach((e=>{r.forEach((o=>{o.applyPlugin(e,t)}))})),e}(e,this);this.options.plugins=this.options.plugins.reduce(((e,t)=>t?(e&&!e.find((e=>e.name===t.name))&&e.push(t),e):e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};Object.defineProperty,"boolean"==typeof FEDERATION_OPTIMIZE_NO_REMOTE&&FEDERATION_OPTIMIZE_NO_REMOTE;let So=null;function _o(e){const t=function(e,t){const o="undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"";return T.__FEDERATION__.__INSTANCES__.find((r=>!(!o||r.options.id!==o)||r.options.name===e&&!r.options.version&&!t||!(r.options.name!==e||!t||r.options.version!==t)))}(e.name,e.version),o={...e,id:e.id||""};return t?(t.initOptions(o),So||(So=t),t):(So=function(e){const t=new(T.__FEDERATION__.__DEBUG_CONSTRUCTOR__||bo)({id:`${e.name}@${e.version||Date.now()}`,...e});return function(e){T.__FEDERATION__.__INSTANCES__.push(e)}(t),t}(o),So)}!function(e,t=m()){t&&(T.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.8.2")}(bo);let wo=!1;const Io=new Set,vo=async(e,t,o,r="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${t}, shareScope: ${r} }`),wo||(wo=!0,So||_o({name:"Appshell",remotes:[]})),Io.has(e)||(Io.add(e),function(...e){S(So,bt,Nt),So.registerRemotes.apply(So,e)}([{name:e,entry:o}]));const n=t.replace(/^\.\//,""),s=await function(...e){return S(So,bt,Nt),So.loadRemote.apply(So,e)}(`${e}/${n}`);if(!s)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${t}, shareScope: ${r} }`),s.default};(Object.getOwnPropertyDescriptor(vo,"name")||{}).writable||Object.defineProperty(vo,"name",{value:"default",configurable:!0});const $o=(e,t)=>({remotes:t,environment:e.environment,modules:{}}),No=(e,t={})=>{const o=t.composition??("undefined"==typeof window?void 0:window.__appshell_config__),r=t.resolver??((...e)=>async t=>{for(const o of e){const e=await o(t);if(e)return e}})((e=>async t=>{const o=e?.remotes[t];if(e&&o)return{remote:o,environment:e.environment[o.scope]??{},manifest:$o(e,e.remotes)}})(o),((e,t="")=>async o=>{if(!e)return;const r=`${t}/v1/environments/${e.environmentId}/remotes/${o}`,n=await fetch(r,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,environment:e.environment[s.scope]??{},manifest:$o(e,{[o]:s})}})(o),(e=>{const t=new Map;return async o=>{const r=e.index?.[o];if(!r)return;const n=await(e=>{const o=t.get(e);if(o)return o;const r=fetch(e,{credentials:"include"}).then((async t=>{if(!t.ok)throw new Error(`Failed to get manifest from ${e}. ${await t.text()}`);return t.json()}));return t.set(e,r),r})(r),s=n?.remotes[o];return s?{remote:s,environment:{...n.environment[s.scope]??{},...e.overrides?.environment?.[s.scope]??{}},manifest:n}:void 0}})(e));return async e=>{const t=t=>new Error(`Failed to load component '${e}'. ${t?.toString()}`);let o;try{o=await r(e)}catch(e){throw t(e)}if(!o)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:n,environment:s,manifest:i}=o;try{return window[`__appshell_env__${n.scope}`]=s,[await vo(n.scope,n.module,n.remoteEntryUrl,n.shareScope),i]}catch(e){throw t(e)}}};(Object.getOwnPropertyDescriptor(No,"name")||{}).writable||Object.defineProperty(No,"name",{value:"default",configurable:!0});const Ro=No;var ko=r(155),Oo=r.n(ko);const To=(0,ko.createContext)({remotes:{},modules:{},environment:{}}),Ao=({manifest:e,children:t})=>{const o=(0,ko.useMemo)((()=>(e=>new Proxy(e,{get:(e,t,o)=>("modules"===t&&console.warn("useManifest().modules is deprecated and will be removed. It is build-time webpack config; use useRemote() for what the browser needs. Please open an issue at github.com/appshell-org/appshell if you rely on it."),Reflect.get(e,t,o))}))(e)),[e]);return Oo().createElement(To.Provider,{value:o},t)},xo=(To.Consumer,To),Po=(0,ko.createContext)(void 0),Mo=({remote:e,children:t})=>Oo().createElement(Po.Provider,{value:e},t);Mo.defaultProps={remote:void 0},Po.Consumer;const Lo=Po,Co=(0,ko.createContext)({index:{}}),jo=({config:e,children:t})=>Oo().createElement(Co.Provider,{value:e},t),Do=(Co.Consumer,Co),Ho=()=>Oo().useContext(Do);(Object.getOwnPropertyDescriptor(Ho,"name")||{}).writable||Object.defineProperty(Ho,"name",{value:"default",configurable:!0});const Fo=({remote:e,reason:t})=>Oo().createElement("div",{style:{border:"3px solid red"}},Oo().createElement("h5",null,`Error loading Appshell component '${e}.'`),Oo().createElement("span",{style:{fontSize:"1rem"}},t)),Uo=({remote:e,fallback:t,...o})=>{const r=Ho(),[n,s]=(0,ko.useState)();return(0,ko.useEffect)((()=>{let t=!1;const n=Ro(r);return s(void 0),async function(){try{const[r,i]=await n(e);if(t||!r)return;s(Oo().createElement(Ao,{manifest:i},Oo().createElement(Mo,{remote:i.remotes[e]},Oo().createElement(r,o))))}catch(o){t||s(Oo().createElement(Fo,{remote:e,reason:`${o}`}))}}(),()=>{t=!0}}),[e,r,...Object.values(o)]),console.debug(`rendering AppshellComponent[${e}], loading=${!n}`),Oo().createElement(Oo().Fragment,null,n||t)};Uo.defaultProps={fallback:void 0};const Go=Uo,Bo=Uo;function Vo(){return Vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Vo.apply(null,arguments)}const Wo=()=>{const e="undefined"==typeof window?void 0:window.__appshell_config__;return e&&{index:e.index}},qo=({configUrl:e,remote:t,fallback:o,...r})=>{const[n,s]=Oo().useState(Wo);return(0,ko.useEffect)((()=>{n||(e?(async()=>{const t=await fetch(e);s(t.ok?await t.json():{index:{}})})():s({index:{}}))}),[n,e]),n?Oo().createElement(jo,{config:n},Oo().createElement(Go,Vo({remote:t,fallback:o},r))):null};qo.defaultProps={configUrl:void 0,fallback:void 0};const zo=qo,Ko=(0,ko.createContext)({}),Zo=({metata:e,children:t})=>Oo().createElement(Ko.Provider,{value:e},t),Jo=(Ko.Consumer,Ko),Yo=()=>Oo().useContext(xo);(Object.getOwnPropertyDescriptor(Yo,"name")||{}).writable||Object.defineProperty(Yo,"name",{value:"default",configurable:!0});const Xo=()=>Oo().useContext(Jo);(Object.getOwnPropertyDescriptor(Xo,"name")||{}).writable||Object.defineProperty(Xo,"name",{value:"default",configurable:!0});const Qo=()=>Oo().useContext(Lo);(Object.getOwnPropertyDescriptor(Qo,"name")||{}).writable||Object.defineProperty(Qo,"name",{value:"default",configurable:!0});const er=e=>{let t,o="pending";const r=fetch(e,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>{o="success",t=e}));o="error",t=new Error(`${e.status} ${e.statusText} ${e.url}`)}));return{read(){if("pending"===o)throw r;if("error"===o)throw t;if("success"===o)return t}}};return(Object.getOwnPropertyDescriptor(er,"name")||{}).writable||Object.defineProperty(er,"name",{value:"default",configurable:!0}),n})()));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@appshell/runtime"),require("react"));else if("function"==typeof define&&define.amd)define(["@appshell/runtime","react"],t);else{var o="object"==typeof exports?t(require("@appshell/runtime"),require("react")):t(e["@appshell/runtime"],e.react);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,((e,t)=>(()=>{"use strict";var o={164(t){t.exports=e},155(e){e.exports=t}},r={};function n(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={exports:{}};return o[e](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};n.r(s),n.d(s,{RemoteProvider:()=>xo,RemoteSlot:()=>Do,jsonResource:()=>Co,useRemote:()=>jo});var i=n(164);const a=".json",c="FEDERATION_DEBUG";let l=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const h="undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:"undefined"!=typeof window&&void 0!==window.document;function m(){return h}function u(){return"undefined"!=typeof navigator&&"ReactNative"===navigator?.product}function d(){return"undefined"!=typeof process&&process.env&&process.env.FEDERATION_DEBUG?Boolean(process.env.FEDERATION_DEBUG):!("undefined"==typeof FEDERATION_DEBUG||!Boolean(FEDERATION_DEBUG))||function(){try{if(m()&&window.localStorage)return Boolean(localStorage.getItem(c))}catch(e){return!1}return!1}()}const f="[ Module Federation ]",p=console,y=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];var g=class{constructor(e,t=p){this.prefix=e,this.delegate=t??p}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??p}emit(e,t){const o=this.delegate,r=d()?function(){try{const e=(new Error).stack;if(!e)return;const[,...t]=e.split("\n"),o=t.filter((e=>!y.some((t=>e.includes(t)))));if(!o.length)return;return`Stack trace:\n${o.slice(0,5).join("\n")}`}catch{return}}():void 0,n=r?[...t,r]:t,s=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const e of s){const t=o[e];if("function"==typeof t)return void t.call(o,this.prefix,...n)}for(const e of s){const t=p[e];if("function"==typeof t)return void t.call(p,this.prefix,...n)}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){d()&&this.emit("debug",e)}};function E(e){return new g(e)}E(f),function(e){const t=new g(e);Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1})}(f);const S=(e,t,o,r)=>{const n=[`${[t[e]]} #${e}`];return o&&n.push(`args: ${JSON.stringify(o)}`),n.push((e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`)(e)),r&&n.push(`Original Error Message:\n ${r}`),n.join("\n")},_="[ Federation Runtime ]",b=E(_);function I(e,t,o,r,n){e||(void 0!==o?w(t,o,r,void 0):w(t))}function w(e,t,o,r,n){if(void 0!==t)return function(e,t,o,r,n){return(e=>{throw new Error(`${_}: ${e}`)})(S(e,t,o,n))}(e,t,o??{},0,r);const s=e;if(s instanceof Error)throw s.message.startsWith(_)||(s.message=`${_}: ${s.message}`),s;throw new Error(`${_}: ${s}`)}function $(e){e instanceof Error?(e.message.startsWith(_)||(e.message=`${_}: ${e.message}`),b.warn(e)):b.warn(e)}function N(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function v(e){return void 0!==e.entry}function R(e){return!e.entry.includes(".json")}function k(e){return e&&"object"==typeof e}const O=Object.prototype.toString;function T(e){return Array.isArray(e)?e:[e]}function A(e){const t={url:"",type:"global",globalName:""};return h||u()||!("ssrRemoteEntry"in e)?"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:"ssrRemoteEntry"in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}const x="object"==typeof globalThis?globalThis:window,M=(()=>{try{return document.defaultView}catch{return x}})(),L=M;function P(e,t,o){Object.defineProperty(e,t,{value:o,configurable:!1,writable:!0})}function D(e,t){return Object.hasOwnProperty.call(e,t)}D(x,"__GLOBAL_LOADING_REMOTE_ENTRY__")||P(x,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const j=x.__GLOBAL_LOADING_REMOTE_ENTRY__;function C(e){D(e,"__VMOK__")&&!D(e,"__FEDERATION__")&&P(e,"__FEDERATION__",e.__VMOK__),D(e,"__FEDERATION__")||(P(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),P(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__??=new Map}function H(e,t){if("string"==typeof t){if(e[t])return{value:e[t],key:t};{const o=Object.keys(e);for(const r of o){const[o,n]=r.split(":"),s=`${o}:${t}`,i=e[s];if(i)return{value:i,key:s}}return{value:void 0,key:t}}}w(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}C(x),C(M);const F=()=>M.__FEDERATION__.moduleInfo,U=e=>((e,t)=>{const o=H(t,N(e)).value;if(o&&!o.version&&"version"in e&&e.version&&(o.version=e.version),o)return o;if("version"in e&&e.version){const{version:t,...o}=e,r=N(o),n=H(M.__FEDERATION__.moduleInfo,r).value;if(n?.version===t)return n}})(e,M.__FEDERATION__.moduleInfo),G=(e,t)=>{const o=N(e);return M.__FEDERATION__.moduleInfo[o]=t,M.__FEDERATION__.moduleInfo},B=(e,t)=>{const o=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:o,entryExports:x[o]}},V=e=>x.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),W="default",q="global",z="[0-9A-Za-z-]+",K=`(?:\\+(${z}(?:\\.${z})*))`,Z="0|[1-9]\\d*",J="[0-9]+",Y="\\d*[a-zA-Z-][a-zA-Z0-9-]*",X=`(?:${J}|${Y})`,Q=`(?:${Z}|${Y})`,ee=`(?:-(${Q}(?:\\.${Q})*))`,te=`${Z}|x|X|\\*`,oe=`[v=\\s]*(${te})(?:\\.(${te})(?:\\.(${te})(?:${ee})?${K}?)?)?`,re=`^\\s*(${oe})\\s+-\\s+(${oe})\\s*$`,ne="((?:<|>)?=?)",se=`(\\s*)${ne}\\s*([v=\\s]*(${J})\\.(${J})\\.(${J})(?:-?(${X}(?:\\.${X})*))?${K}?|${oe})`,ie="(?:~>?)",ae=`(\\s*)${ie}\\s+`,ce="(?:\\^)",le=`(\\s*)${ce}\\s+`,he="(<|>)?=?\\s*\\*",me=`^${ce}${oe}$`,ue=`^${ie}${oe}$`,de=`^${ne}\\s*${oe}$`,fe=`^${ne}\\s*(v?(${Z})\\.(${Z})\\.(${Z})${ee}?${K}?)$|^$`,pe="^\\s*>=\\s*0.0.0\\s*$";function ye(e){return new RegExp(e)}function ge(e){return!e||"x"===e.toLowerCase()||"*"===e}function Ee(...e){return t=>e.reduce(((e,t)=>t(e)),t)}function Se(e){return e.match(ye(fe))}function _e(e,t,o,r){const n=`${e}.${t}.${o}`;return r?`${n}-${r}`:n}function be(e){return e.replace(ye(re),((e,t,o,r,n,s,i,a,c,l,h,m)=>`${t=ge(o)?"":ge(r)?`>=${o}.0.0`:ge(n)?`>=${o}.${r}.0`:`>=${t}`} ${a=ge(c)?"":ge(l)?`<${Number(c)+1}.0.0-0`:ge(h)?`<${c}.${Number(l)+1}.0-0`:m?`<=${c}.${l}.${h}-${m}`:`<=${a}`}`.trim()))}function Ie(e){return e.replace(ye(se),"$1$2$3")}function we(e){return e.replace(ye(ae),"$1~")}function $e(e){return e.replace(ye(le),"$1^")}function Ne(e){return e.trim().split(/\s+/).map((e=>e.replace(ye(me),((e,t,o,r,n)=>ge(t)?"":ge(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:ge(r)?"0"===t?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.0 <${Number(t)+1}.0.0-0`:n?"0"===t?"0"===o?`>=${t}.${o}.${r}-${n} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r}-${n} <${Number(t)+1}.0.0-0`:"0"===t?"0"===o?`>=${t}.${o}.${r} <${t}.${o}.${Number(r)+1}-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${Number(t)+1}.0.0-0`)))).join(" ")}function ve(e){return e.trim().split(/\s+/).map((e=>e.replace(ye(ue),((e,t,o,r,n)=>ge(t)?"":ge(o)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:ge(r)?`>=${t}.${o}.0 <${t}.${Number(o)+1}.0-0`:n?`>=${t}.${o}.${r}-${n} <${t}.${Number(o)+1}.0-0`:`>=${t}.${o}.${r} <${t}.${Number(o)+1}.0-0`)))).join(" ")}function Re(e){return e.split(/\s+/).map((e=>e.trim().replace(ye(de),((e,t,o,r,n,s)=>{const i=ge(o),a=i||ge(r),c=a||ge(n);return"="===t&&c&&(t=""),s="",i?">"===t||"<"===t?"<0.0.0-0":"*":t&&c?(a&&(r=0),n=0,">"===t?(t=">=",a?(o=Number(o)+1,r=0,n=0):(r=Number(r)+1,n=0)):"<="===t&&(t="<",a?o=Number(o)+1:r=Number(r)+1),"<"===t&&(s="-0"),`${t+o}.${r}.${n}${s}`):a?`>=${o}.0.0${s} <${Number(o)+1}.0.0-0`:c?`>=${o}.${r}.0${s} <${o}.${Number(r)+1}.0-0`:e})))).join(" ")}function ke(e){return e.trim().replace(ye(he),"")}function Oe(e,t){return(e=Number(e)||e)>(t=Number(t)||t)?1:e===t?0:-1}function Te(e,t){return Oe(e.major,t.major)||Oe(e.minor,t.minor)||Oe(e.patch,t.patch)||function(e,t){const{preRelease:o}=e,{preRelease:r}=t;if(void 0===o&&Boolean(r))return 1;if(Boolean(o)&&void 0===r)return-1;if(void 0===o&&void 0===r)return 0;for(let e=0,t=o.length;e<=t;e++){const t=o[e],n=r[e];if(t!==n)return void 0===t&&void 0===n?0:t?n?Oe(t,n):-1:1}return 0}(e,t)}function Ae(e,t){return e.version===t.version}function xe(e,t){switch(e.operator){case"":case"=":return Ae(e,t);case">":return Te(e,t)<0;case">=":return Ae(e,t)||Te(e,t)<0;case"<":return Te(e,t)>0;case"<=":return Ae(e,t)||Te(e,t)>0;case void 0:return!0;default:return!1}}function Me(e){return Ee(Ne,ve,Re,ke)(e)}function Le(e){return Ee(be,Ie,we,$e)(e.trim()).split(/\s+/).join(" ")}function Pe(e,t){if(!e)return!1;const o=Se(e);if(!o)return!1;const[,r,,n,s,i,a]=o,c={operator:r,version:_e(n,s,i,a),major:n,minor:s,patch:i,preRelease:a?.split(".")},l=t.split("||");for(const e of l){const t=e.trim();if(!t)return!0;if("*"===t||"x"===t)return!0;try{const e=Le(t);if(!e.trim())return!0;const o=e.split(" ").map((e=>Me(e))).join(" ");if(!o.trim())return!0;const r=o.split(/\s+/).map((e=>e.trim().replace(ye(pe),""))).filter(Boolean);if(0===r.length)continue;let n=!0;for(const e of r){const t=Se(e);if(!t){n=!1;break}const[,o,,r,s,i,a]=t;if(!xe({operator:o,version:_e(r,s,i,a),major:r,minor:s,patch:i,preRelease:a?.split(".")},c)){n=!1;break}}if(n)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}function De(e,t){const o=t.shared||{},r=t.name,n=Object.keys(o).reduce(((e,n)=>{const s=T(o[n]);return e[n]=e[n]||[],s.forEach((o=>{e[n].push(function(e,t,o,r){let n;return n="get"in e?e.get:"lib"in e?()=>Promise.resolve(e.lib):()=>Promise.resolve((()=>{w(`Cannot get shared "${o}" from "${t}": neither "get" nor "lib" is provided in the share config.`)})),e.shareConfig?.eager&&e.treeShaking?.mode&&w(`Invalid shared config for "${o}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:n,loaded:!(!e?.loaded&&!("lib"in e))||void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??r)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??l.UNKNOWN,useIn:[]}:void 0}}(o,r,n,t.shareStrategy))})),e}),{}),s={...e.shared};return Object.keys(n).forEach((e=>{s[e]?n[e].forEach((t=>{s[e].find((e=>e.version===t.version))||s[e].push(t)})):s[e]=n[e]})),{allShareInfos:s,newShareInfos:n}}function je(e,t){if(!e)return!1;const{status:o,mode:r}=e;return o!==l.NO_USE&&(o===l.CALCULATED||"runtime-infer"===r&&(!t||Ue(e,t)))}function Ce(e,t){const o=e=>{if(!Number.isNaN(Number(e))){const t=e.split(".");let o=e;for(let e=0;e<3-t.length;e++)o+=".0";return o}return e};return!!Pe(o(e),`<=${o(t)}`)}const He=(e,t)=>{const o=t||function(e,t){return Ce(e,t)};return Object.keys(e).reduce(((e,t)=>e?o(e,t)||"0"===e?t:e:t),0)},Fe=e=>Boolean(e.loaded)||"function"==typeof e.lib,Ue=(e,t)=>{if(!e||!t)return!1;const{usedExports:o}=e;return!!o&&!!t.every((e=>o.includes(e)))};function Ge(e,t,o,r){const n=e[t][o];let s="",i=je(r);const a=function(e,t){return i?!n[e].treeShaking||!!n[t].treeShaking&&!Fe(n[e].treeShaking)&&Ce(e,t):!Fe(n[e])&&Ce(e,t)};if(i){if(s=He(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:He(e[t][o],a),useTreesShaking:i}}const Be=e=>Fe(e)||(e=>Boolean(e.loading))(e);function Ve(e,t,o,r){const n=e[t][o];let s="",i=je(r);const a=function(e,t){if(i){if(!n[e].treeShaking)return!0;if(!n[t].treeShaking)return!1;if(Be(n[t].treeShaking))return!Be(n[e].treeShaking)||Boolean(Ce(e,t));if(Be(n[e].treeShaking))return!1}return Be(n[t])?!Be(n[e])||Boolean(Ce(e,t)):!Be(n[e])&&Ce(e,t)};if(i){if(s=He(e[t][o],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:He(e[t][o],a),useTreesShaking:i}}function We(e){return"loaded-first"===e?Ve:Ge}function qe(e,t,o,r){if(!e)return;const{shareConfig:n,scope:s=W,strategy:i,treeShaking:a}=o,c=Array.isArray(s)?s:[s];for(const s of c)if(n&&e[s]&&e[s][t]){const{requiredVersion:c}=n,{version:l,useTreesShaking:h}=We(i)(e,s,t,a),m=()=>{const r=e[s][t][l];if(n.singleton){if("string"==typeof c&&!Pe(l,c)){const e=`Version ${l} from ${l&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${c})`;n.strictVersion?w(e):$(e)}return{shared:r,useTreesShaking:h}}{if(!1===c||"*"===c)return{shared:r,useTreesShaking:h};if(Pe(l,c))return{shared:r,useTreesShaking:h};const o=je(a);if(o)for(const[r,n]of Object.entries(e[s][t]))if(je(n.treeShaking,a?.usedExports)&&Pe(r,c))return{shared:n,useTreesShaking:o};for(const[o,r]of Object.entries(e[s][t]))if(Pe(o,c))return{shared:r,useTreesShaking:!1}}},u={shareScopeMap:e,scope:s,pkgName:t,version:l,GlobalFederation:L.__FEDERATION__,shareInfo:o,resolver:m};return(r.emit(u)||u).resolver()}}function ze(){return L.__FEDERATION__.__SHARE__}function Ke(e){const{pkgName:t,extraOptions:o,shareInfos:r}=e,n=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),s=(...e)=>{const t={};for(const o of e)if(o)for(const[e,r]of Object.entries(o)){const o=t[e];n(o)&&n(r)?t[e]=s(o,r):void 0!==r&&(t[e]=r)}return t};return s((o?.resolver??(e=>{if(!e)return;const t={};return e.forEach((e=>{t[e.version]=e})),t[He(t,(function(e,o){return!Fe(t[e])&&Ce(e,o)}))]}))(r[t]),o?.customShareInfo)}const Ze=(e,t)=>{var o,r;e.useIn||(e.useIn=[]),o=e.useIn,r=t,-1===o.findIndex((e=>e===r))&&o.push(r)};function Je(e,t){return t&&e.treeShaking?e.treeShaking:e}const Ye=function(...e){return e.length?e.reduce(((e,t)=>t?e?`${e}:${t}`:t:e),""):""};function Xe(e,t){if("getPublicPath"in e){let o;return o=e.getPublicPath.startsWith("function")?new Function("return "+e.getPublicPath)()():new Function(e.getPublicPath)(),`${o}${t}`}return"publicPath"in e?m()||u()||!("ssrPublicPath"in e)||"string"!=typeof e.ssrPublicPath?`${e.publicPath}${t}`:`${e.ssrPublicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")}const Qe=e=>{console.warn(`[ Federation Runtime ]: ${e}`)};function et(e){try{return JSON.stringify(e,null,2)}catch(e){return""}}async function tt(e,t){try{return await e()}catch(e){return void(!t&&Qe(e))}}function ot(e,t){const o=/^(https?:)?\/\//i;return e.replace(o,"").replace(/\/$/,"")===t.replace(o,"").replace(/\/$/,"")}function rt(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("script");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("src");if(i&&ot(i,e.url)){o=n,r=!1;break}}if(!o){const t=e.attrs;let r;o=document.createElement("script"),o.type="module"===t?.type?"module":"text/javascript",e.createScriptHook&&(r=e.createScriptHook(e.url,e.attrs),r instanceof HTMLScriptElement?o=r:"object"==typeof r&&("script"in r&&r.script&&(o=r.script),"timeout"in r&&r.timeout&&(n=r.timeout))),o.src||(o.src=e.url),t&&!r&&Object.keys(t).forEach((e=>{o&&("async"===e||"defer"===e?o[e]=t[e]:o.getAttribute(e)||o.setAttribute(e,t[e]))}))}let i=null;const a="undefined"!=typeof window?t=>{if(t.filename&&ot(t.filename,e.url)){const o=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);o.name="ScriptExecutionError",i=o}}:null;a&&window.addEventListener("error",a);const c=async(r,n)=>{clearTimeout(t),a&&window.removeEventListener("error",a);const s=()=>{if("error"===n?.type){const t=new Error(n?.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.)`);t.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else i?e?.onErrorCallback&&e?.onErrorCallback(i):e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,tt((()=>{const{needDeleteScript:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r&&"function"==typeof r)){const e=r(n);if(e instanceof Promise){const t=await e;return s(),t}return s(),e}s()};return o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),t=setTimeout((()=>{c(null,{type:"error",isTimeout:!0})}),n),{script:o,needAttach:r}}const nt=new Map;function st(e){if(!e)throw new Error("import specifier is required");if(nt.has(e))return nt.get(e);const t=new Function("name","return import(name)")(e).then((e=>e)).catch((t=>{throw console.error(`Error importing module ${e}:`,t),nt.delete(e),t}));return nt.set(e,t),t}const it="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t,o,r)=>{if(r?.createScriptHook){const t=r.createScriptHook(e);t&&"object"==typeof t&&"url"in t&&(e=t.url)}let n;try{n=new URL(e)}catch(e){return console.error("Error constructing URL:",e),void t(new Error(`Invalid URL: ${e}`))}(async()=>r?.fetch?(e,t)=>(async(e,t,o)=>{const r=await((e,t)=>o.lifecycle.fetch.emit(e,t))(e,t||{});return r&&r instanceof Response?r:fetch(e,t||{})})(e,t,r):fetch)().then((async e=>{if("esm"===o?.type||"module"===o?.type)return ut(n.href,{fetch:e,vm:await st("vm")}).then((async e=>{await e.evaluate(),t(void 0,e.namespace)})).catch((e=>{t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}));(async(e,r)=>{try{const n=await e(r.href),s=await n.text(),[i,a]=await Promise.all([st("path"),st("vm")]),c={exports:{},module:{exports:{}}},l=r.pathname.split("/").slice(0,-1).join("/"),h=i.basename(r.pathname),m=new a.Script(`(function(exports, module, require, __dirname, __filename) {${s}\n})`,{filename:h,importModuleDynamically:a.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??st});let u;u=(await st("node:module")).createRequire("file:"===r.protocol||"node:"===r.protocol?r.href:i.join(process.cwd(),"__mf_require_base__.js")),m.runInThisContext()(c.exports,c.module,u,l,h);const d=c.module.exports||c.exports;if(o&&d&&o.globalName)return void t(void 0,d[o.globalName]||d);t(void 0,d)}catch(e){t(e instanceof Error?e:new Error(`Script execution error: ${e}`))}})(e,n)})).catch((e=>{t(e)}))}:(e,t,o,r)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},at="undefined"==typeof ENV_TARGET||"web"!==ENV_TARGET?(e,t)=>new Promise(((o,r)=>{it(e,((e,n)=>{e?r(e):o(globalThis[t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`]=n)}),t.attrs,t.loaderHook)})):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},ct=new Map,lt=e=>e.startsWith("http:")||e.startsWith("https:"),ht=e=>!(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes(":"));async function mt(e,t,o){if(await async function(e){return!!e.startsWith("node:")||!!ht(e)&&(await st("node:module")).builtinModules.includes(e)}(e))return async function(e,t){const o=`node-builtin:${e}`;return ct.has(o)?ct.get(o):async function(e,t,o){if("function"!=typeof o.SyntheticModule)throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const r=function(e){const t=!e||"object"!=typeof e&&"function"!=typeof e?{default:e}:e,o={...t};return Object.prototype.hasOwnProperty.call(o,"default")||(o.default=t),o}(t),n=Object.keys(r),s=new o.SyntheticModule(n,(function(){for(const e of n)this.setExport(e,r[e])}),{identifier:e});return ct.set(e,s),await s.link((async()=>{throw new Error(`Node.js built-in module "${e}" should not request child modules.`)})),await s.evaluate(),s}(o,await st(e),t)}(e,o.vm);if(ht(e))throw new Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);const r=new URL(e,t).href;if(!lt(r))throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${r}". Only http(s) remote modules and Node.js built-in modules are supported.`);return ut(r,o)}async function ut(e,t){if(ct.has(e))return ct.get(e);const{fetch:o,vm:r}=t;if(!lt(e))throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);const n=await(await o(e)).text(),s=(await st("node:url")).pathToFileURL(process.cwd()).href,i=new r.SourceTextModule(n,{identifier:e,initializeImportMeta:t=>{t.url=function(e,t){const o=t.endsWith("/")?t:`${t}/`;return new URL(`__module_federation_remote__${function(e){const t=new URL(e),o=encodeURIComponent(t.protocol.slice(0,-1)),r=encodeURIComponent(t.host),n=t.pathname.split("/").map((e=>encodeURIComponent(e))).join("/"),s=encodeURIComponent(`${t.search}${t.hash}`);return`/${o}/${r}${n}${s?`/${s}`:""}`}(e)}`,o).href}(e,s)},importModuleDynamically:async o=>async function(e){if("linked"===e.status&&await e.evaluate(),"errored"===e.status)throw e.error;return e}(await mt(o,e,t))});return ct.set(e,i),await i.link((async o=>mt(o,e,t))),i}const dt="RUNTIME-001",ft="RUNTIME-002",pt="RUNTIME-003",yt="RUNTIME-004",gt="RUNTIME-005",Et="RUNTIME-006",St="RUNTIME-007",_t="RUNTIME-008",bt="RUNTIME-009",It="RUNTIME-010",wt="RUNTIME-011",$t="RUNTIME-012",Nt="RUNTIME-013",vt="RUNTIME-014",Rt="RUNTIME-015",kt={[dt]:"Failed to get remoteEntry exports.",[ft]:'The remote entry interface does not contain "init"',[pt]:"Failed to get manifest.",[yt]:"Failed to locate remote.",[gt]:"Invalid loadShareSync function call from bundler runtime",[Et]:"Invalid loadShareSync function call from runtime",[St]:"Failed to get remote snapshot.",[_t]:"Failed to load script resources.",[bt]:"Please call createInstance first.",[It]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[wt]:"The remoteEntry URL is missing from the remote snapshot.",[$t]:'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.',[Nt]:"The manifest is not a valid Module Federation manifest.",[vt]:"The remote does not expose the requested module.",[Rt]:"Remote container initialization failed."},Ot=".then(callbacks[0]).catch(callbacks[1])",Tt=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function At(e){return"esm"===e||"module"===e}function xt(e,t,o){const{remoteEntryKey:r,entryExports:n}=B(e,t);return n||w(dt,kt,{remoteName:e,remoteEntryUrl:o,remoteEntryKey:r}),n}async function Mt({remoteInfo:e,remoteEntryExports:t,loaderHook:o,getEntryUrl:r,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return At(c)?async function({entry:e,remoteEntryExports:t,name:o,getEntryUrl:r}){return new Promise(((n,s)=>{const i=e=>{if((t=e)instanceof TypeError&&Tt.some((e=>t.message.includes(e)))){const t=e instanceof Error?e.message:String(e);try{w(_t,kt,{remoteName:o,resourceUrl:a},t)}catch(e){return void s(e)}}var t;s(e)},a=r?r(e):e;try{t?n(t):"undefined"!=typeof FEDERATION_ALLOW_NEW_FUNCTION?new Function("callbacks",`import("${a}")${Ot}`)([n,i]):import(a).then(n).catch(i)}catch(e){w(`Failed to load ESM entry from "${a}". ${e instanceof Error?e.message:String(e)}`)}}))}({entry:s,remoteEntryExports:t,name:a,getEntryUrl:r}):"system"===c?async function({entry:e,remoteEntryExports:t}){return new Promise(((o,r)=>{try{t?o(t):new Function("callbacks",`System.import("${e}")${Ot}`)([o,r])}catch(t){w(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}}))}({entry:s,remoteEntryExports:t}):async function({name:e,globalName:t,entry:o,remoteInfo:r,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=B(e,t);if(a)return a;const c=s?s(o):o;return function(e,t){const{attrs:o={},createScriptHook:r}=t;return new Promise(((t,n)=>{const{script:s,needAttach:i}=rt({url:e,cb:t,onErrorCallback:n,attrs:{fetchpriority:"high",...o},createScriptHook:r,needDeleteScript:!0});i&&document.head.appendChild(s)}))}(c,{attrs:{},createScriptHook:(e,t)=>{const o=n.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:i?{...i,url:e}:void 0});if(o)return o instanceof HTMLScriptElement||"script"in o||"timeout"in o?o:void 0}}).then((()=>xt(e,t,o)),(t=>{const o=t instanceof Error?t.message:String(t);w(_t,kt,{remoteName:e,resourceUrl:c},o)}))}({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:o,getEntryUrl:r,resourceContext:n})}function Lt(e){const{entry:t,name:o}=e;return Ye(o,t)}async function Pt(e){const{origin:t,remoteEntryExports:o,remoteInfo:r,getEntryUrl:n,resourceContext:s,_inErrorHandling:i=!1}=e,a=Lt(r);if(o)return o;if(!j[a]){const e=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;j[a]=e.emit({origin:t,loaderHook:c,remoteInfo:r,remoteEntryExports:o}).then((e=>e||(("undefined"!=typeof ENV_TARGET?"web"===ENV_TARGET:h)?Mt({remoteInfo:r,remoteEntryExports:o,loaderHook:c,getEntryUrl:n,resourceContext:s}):async function({remoteInfo:e,loaderHook:t,resourceContext:o}){const{entry:r,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=B(s,n);return a||at(r,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(r,n={})=>{const s=t.lifecycle.createScript.emit({url:r,attrs:n,remoteInfo:e,resourceContext:o?{...o,url:r}:void 0});if(s)return"url"in s?s:void 0}}}).then((()=>xt(s,n,r))).catch((e=>{w(`Failed to load Node.js entry for remote "${s}" from "${r}". ${e instanceof Error?e.message:String(e)}`)}))}({remoteInfo:r,loaderHook:c,resourceContext:s})))).then((async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e))).catch((async e=>{const n=Lt(r),s=e instanceof Error&&e.message.includes("ScriptExecutionError");if(e instanceof Error&&e.message.includes(_t)&&!s&&!i){const e=e=>Pt({...e,_inErrorHandling:!0}),s=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e,origin:t,remoteInfo:r,remoteEntryExports:o,globalLoading:j,uniqueKey:n});if(s)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:s,recovered:!0}),s}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e}))}return j[a]}function Dt(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||q,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||W}}function jt(e,t){return t&&"."!==t?`${e}/${t.replace(/^\.\//,"")}`:e}function Ct(e,t){for(const o of e){const e=t.startsWith(o.name);let r=t.replace(o.name,"");if(e){if(r.startsWith("/"))return r=`.${r}`,{pkgNameOrAlias:o.name,expose:r,remote:o};if(""===r)return{pkgNameOrAlias:o.name,expose:".",remote:o}}const n=o.alias&&t.startsWith(o.alias);let s=o.alias&&t.replace(o.alias,"");if(o.alias&&n){if(s&&s.startsWith("/"))return s=`.${s}`,{pkgNameOrAlias:o.alias,expose:s,remote:o};if(""===s)return{pkgNameOrAlias:o.alias,expose:".",remote:o}}}}function Ht(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Ft(e){return e instanceof Error&&(e.message.includes("timed out")||e.name.includes("Timeout"))}function Ut(e,t,o,r){return{url:t,status:o,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}function Gt({host:e,remoteInfo:t,url:o,attrs:r,context:n,needDeleteLink:s}){return new Promise((i=>{const{link:a,needAttach:c}=function(e){let t,o=null,r=!0,n=2e4;const s=document.getElementsByTagName("link");for(let t=0;t<s.length;t++){const n=s[t],i=n.getAttribute("href"),a=n.getAttribute("rel");if(i&&ot(i,e.url)&&a===e.attrs.rel){o=n,r=!1;break}}if(!o){let t;o=document.createElement("link"),o.setAttribute("href",e.url);let r=!0;const s=e.attrs;e.createLinkHook&&(t=e.createLinkHook(e.url,s),t instanceof HTMLLinkElement?(o=t,r=!1):"object"==typeof t&&("link"in t&&t.link&&(o=t.link,r=!1),"timeout"in t&&t.timeout&&(n=t.timeout))),s&&r&&Object.keys(s).forEach((e=>{o&&!o.getAttribute(e)&&o.setAttribute(e,s[e])}))}if(!r)return Promise.resolve().then((()=>{e?.cb&&e?.cb()})),{link:o,needAttach:r};const i=(r,n)=>{t&&clearTimeout(t);const s=()=>{if("error"===n?.type){const t=new Error(n?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(o&&(o.onerror=null,o.onload=null,tt((()=>{const{needDeleteLink:t=!0}=e;t&&o?.parentNode&&o.parentNode.removeChild(o)})),r)){const e=r(n);return s(),e}s()};return o.onerror=i.bind(null,o.onerror),o.onload=i.bind(null,o.onload),t=setTimeout((()=>{i(null,{type:"error",isTimeout:!0})}),n),{link:o,needAttach:r}}({url:o,cb:()=>{i(Ut(n,o,c?"success":"cached"))},onErrorCallback:e=>{i(Ut(n,o,Ft(e)?"timeout":"error",e))},attrs:r,createLinkHook:(o,r)=>{const s=e.loaderHook.lifecycle.createLink.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLLinkElement,s},needDeleteLink:s});c&&document.head.appendChild(a)}))}function Bt({host:e,remoteInfo:t,url:o,attrs:r,context:n}){return new Promise((s=>{const{script:i,needAttach:a}=rt({url:o,cb:()=>{s(Ut(n,o,a?"success":"cached"))},onErrorCallback:e=>{s(Ut(n,o,Ft(e)?"timeout":"error",e))},attrs:r,createScriptHook:(o,r)=>{const s=e.loaderHook.lifecycle.createScript.emit({url:o,attrs:r,remoteInfo:t,resourceContext:{...n,url:o}});return HTMLScriptElement,s},needDeleteScript:!0});a&&document.head.appendChild(i)}))}function Vt(e,t){return{...e,resourceType:t}}function Wt(e,t,o,r=!0,n={initiator:"preloadRemote",id:e.name}){const{cssAssets:s,jsAssetsWithoutEntry:i,entryAssets:a}=o,c=[];if(t.options.inBrowser){if(a.forEach((e=>{const{moduleInfo:o}=e;c.push(async function(e,t,o,r){const n=e.moduleCache.get(o.name),s=o.entry;if(n?.remoteEntryExports)return Ut(r,s,"cached");try{if(!await Pt({origin:e,remoteInfo:o,remoteEntryExports:n?.remoteEntryExports,resourceContext:{...r,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return Ut(r,s,"success")}catch(e){return Ut(r,s,Ft(e)?"timeout":"error",e)}}(t,0,o,Vt(n,"remoteEntry")))})),r){const o={rel:"preload",as:"style"};s.forEach((r=>{c.push(Gt({host:t,remoteInfo:e,url:r,attrs:o,context:Vt(n,"css")}))}))}else{const o={rel:"stylesheet",type:"text/css"};s.forEach((r=>{c.push(Gt({host:t,remoteInfo:e,url:r,attrs:o,needDeleteLink:!1,context:Vt(n,"css")}))}))}let o=Bt,l={fetchpriority:"high",type:"text/javascript"};r?(o=Gt,l={rel:"preload",as:"script"}):At(e.type)&&(o=Gt,l={rel:"modulepreload",fetchpriority:"high"}),i.forEach((r=>{c.push(o({host:t,remoteInfo:e,url:r,attrs:l,context:Vt(n,"js")}))}))}return Promise.all(c)}function qt(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function zt(e){const t={};for(const[o,r]of Object.entries(e.shared)){const e=r[0];e&&(t[o]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:!1!==e.shareConfig?.requiredVersion&&e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(qt)??[],shared:t}}}function Kt(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map((e=>e.moduleName)).filter(Boolean);return t.length?t.join(","):void 0}var Zt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await Pt({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:jt(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return I(t,`remoteEntryExports is undefined \n ${et(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,o,r){const n=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host}),n;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,cached:!0,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,cached:!0,origin:this.host}),o}return n}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:r,shareScope:s,initScope:i}=function(e,t,o){const r=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach((e=>{r[e]||(r[e]={})}));const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:r[n[0]],initScope:o??[]}}(this.remoteInfo,this.host.shareScopeMap,o),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:r,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});void 0===n?.init&&w(ft,kt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,zt(this.host.options));try{await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions)}catch(e){w(Rt,kt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,zt(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:n,error:o,origin:this.host}),o}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,o,r){const{loadFactory:n=!0}=o||{loadFactory:!0},s=await this.init(e,r,void 0,t);let i;this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});try{const o=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i="function"==typeof o?o:void 0,i||(i=await s.get(t)),i||w(vt,kt,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Kt(r)},void 0,zt(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,moduleFactory:i,origin:this.host})}catch(o){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:o,origin:this.host}),o}const a=((e,t)=>{let o;return o=e.endsWith("/")?e.slice(0,-1):e,t.startsWith(".")&&(t=t.slice(1)),o+=t,o})(this.remoteInfo.name,t),c=this.wraperFactory(i,a);if(!n)return c;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,origin:this.host});try{const o=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:o,origin:this.host}),o}catch(o){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:o,origin:this.host}),o}}wraperFactory(e,t){function o(e,t){e&&"object"==typeof e&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for("mf_module_id"))&&Object.defineProperty(e,Symbol.for("mf_module_id"),{value:t,enumerable:!1})}return()=>{const r=e();return r instanceof Promise?r.then((e=>(o(e,t),e))):(o(r,t),r)}}},Jt=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var o;I((o=e,"[object Object]"===O.call(o)),"Plugin configuration is invalid.");const r=e.name;I(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach((t=>{const o=e[t];o&&this.lifecycle[t].on(o)})))}removePlugin(e){I(e,"A name is required.");const t=this.registerPlugins[e];I(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach((e=>{"name"!==e&&this.lifecycle[e].remove(t[e])}))}},Yt=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){"function"==typeof e&&this.listeners.add(e)}once(e){const t=this;this.on((function o(...r){return t.remove(o),e.apply(null,r)}))}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach((o=>{const r=o(...e);void 0!==r&&(t=r)})),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}};function Xt(e,t){if(!k(t))return!1;if(e!==t)for(const o in e)if(!(o in t))return!1;return!0}var Qt=class extends Yt{constructor(e){super(),this.onerror=w,this.type=e}emit(e){k(e)||w(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const o=t(e);if(void 0===o)continue;if(!Xt(e,o)){this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}e=o}catch(e){$(e),this.onerror(e)}return e}},eo=class extends Yt{constructor(e){super(),this.onerror=w,this.type=e}emit(e){k(e)||w(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let o=0;const r=t=>($(t),this.onerror(t),e),n=s=>{if(void 0!==s&&Xt(e,s))e=s;else if(void 0!==s)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(o<t.length)try{return Promise.resolve(t[o++](e)).then(n,r)}catch(e){return r(e)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const to="Remote loading is disabled by experiments.optimization.disableRemote.";var oo=class{constructor(){this.hooks=new Jt({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(to)}preloadRemote(){throw new Error(to)}registerRemotes(){throw new Error(to)}getRemoteModuleAndOptions(){throw new Error(to)}initRawContainer(){throw new Error(to)}},ro=class extends Yt{emit(...e){let t;const o=Array.from(this.listeners);if(o.length>0){let r=0;const n=t=>!1!==t&&(r<o.length?Promise.resolve(o[r++].apply(null,e)).then((o=>void 0===o||1===e.length&&o===e[0]?n(t):n(o))):t);t=n()}return Promise.resolve(t)}};function no(e,t){const o=A(t);o.url||w(wt,kt,{remoteName:e.name});let r=Xe(t,o.url);h||r.startsWith("http")||(r=`https:${r}`),e.type=o.type,e.entryGlobalName=o.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}const so=(e,t)=>{if(!e)return t;const o=(e=>{if("."===e)return"";if(e.startsWith("./"))return e.replace("./","");if(e.startsWith("/")){const t=e.slice(1);return t.endsWith("/")?t.slice(0,-1):t}return e})(e);return o?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:t};function io(e){return!(!("remoteEntry"in e)||!e.remoteEntry.includes(a))}function ao(e){const t=e.split(":");return 1===t.length?{name:t[0],version:void 0}:2===t.length?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function co(e,t,o,r,n={},s){const{value:i}=H(e,N(t)),a=s||i;if(a&&!io(a)&&(o(a,t,r),a.remotesInfo)){const t=Object.keys(a.remotesInfo);for(const r of t){if(n[r])continue;n[r]=!0;const t=ao(r),s=a.remotesInfo[r];co(e,{name:t.name,version:s.matchedVersion},o,!1,n,void 0)}}}const lo=(e,t)=>document.querySelector(`${e}[${"link"===e?"href":"src"}="${t}"]`);function ho(e,t,o,r,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:h}=e,{preloadConfig:m}=t,{depsRemote:u}=m;if(co(r,o,((t,o,r)=>{let n;if(r)n=m;else if(Array.isArray(u)){const e=u.find((e=>e.nameOrAlias===o.name||e.nameOrAlias===o.alias));if(!e)return;n=Ht(e)}else{if(!0!==u)return;n=m}const c=Xe(t,A(t).url);c&&a.push({name:o.name,moduleInfo:{name:o.name,entry:c,type:"remoteEntryType"in t?t.remoteEntryType:"global",entryGlobalName:"globalName"in t?t.globalName:o.name,shareScope:"",version:"version"in t?t.version:void 0},url:c});let l="modules"in t?t.modules:[];const h=(d=n.exposes)?d.map((e=>"."===e?e:e.startsWith("./")?e.replace("./",""):e)):[];var d,f;function p(e){const o=e.map((e=>Xe(t,e)));return n.filter?o.filter(n.filter):o}if(h.length&&"modules"in t&&(l=t?.modules?.reduce(((e,t)=>(-1!==h?.indexOf(t.moduleName)&&e.push(t),e)),[])),l){const r=l.length;for(let a=0;a<r;a++){const r=l[a],c=`${o.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:"."===r.moduleName?o.name:c,name:o.name,remoteSnapshot:t,preloadConfig:n,remote:o,origin:e}),f=c,x.__FEDERATION__.__PRELOADED_MAP__.get(f)||("all"===n.resourceCategory?(s.push(...p(r.assets.css.async)),s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.async)),i.push(...p(r.assets.js.sync))):"sync"===n.resourceCategory&&(s.push(...p(r.assets.css.sync)),i.push(...p(r.assets.js.sync))),V(c))}}}),!0,{},n),n.shared&&n.shared.length>0){const t=(t,o)=>{const{shared:r}=qe(e.shareScopeMap,o.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&"function"==typeof r.lib&&(o.assets.js.sync.forEach((e=>{c.add(e)})),o.assets.css.sync.forEach((e=>{l.add(e)})))};n.shared.forEach((e=>{const o=h.shared?.[e.sharedName];if(!o)return;const r=e.version?o.find((t=>t.version===e.version)):o;r&&T(r).forEach((o=>{t(o,e)}))}))}const d=i.filter((e=>!c.has(e)&&!lo("script",e)));return{cssAssets:s.filter((e=>!l.has(e)&&!lo("link",e))),jsAssetsWithoutEntry:d,entryAssets:a.filter((e=>!lo("script",e.url)))}}function mo(e,t){const o=U({name:t.name,version:t.options.version}),r=o&&"remotesInfo"in o&&o.remotesInfo&&H(o.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:o,globalSnapshot:F(),remoteSnapshot:U({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:F(),remoteSnapshot:U({name:e.name,version:"version"in e?e.version:void 0})}}var uo=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new Jt({beforeLoadRemoteSnapshot:new ro("beforeLoadRemoteSnapshot"),loadSnapshot:new eo("loadGlobalSnapshot"),loadRemoteSnapshot:new eo("loadRemoteSnapshot"),afterLoadSnapshot:new eo("afterLoadSnapshot")}),this.manifestLoading=L.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:o="loadRemote"}){const{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let n=U({name:this.HostInstance.options.name,version:this.HostInstance.options.version});var s;n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},s={[this.HostInstance.options.name]:n},M.__FEDERATION__.moduleInfo={...M.__FEDERATION__.moduleInfo,...s}),n&&"remotesInfo"in n&&!H(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:i,remoteSnapshot:a,globalSnapshot:c}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:m}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:i,remoteSnapshot:a,globalSnapshot:c});let u,d;if(l)if(io(l)){const r=h?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||"",n=await this.loadManifestSnapshot(r,e,{},{initiator:o,id:t||e.name});u=n,d=G({...e,entry:r},n)}else{const{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});u=t,d=m}else if(v(e)){const r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:o,id:t||e.name});u=r,d=G(e,r)}else w(St,kt,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(m)},void 0,zt(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:d}}getGlobalRemoteInfo(e){return mo(e,this.HostInstance)}async getManifestJson(e,t,o,r){return(async()=>{const o=Dt(t);let n=this.manifestCache.get(e);if(n)return n;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},o,r?{...r,url:e,resourceType:"manifest"}:void 0);t&&t instanceof Response||(t=await fetch(e,{})),n=await t.json()}catch(r){n=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),n||(delete this.manifestLoading[e],w(pt,kt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,zt(this.HostInstance.options)))}const s=[!n.metaData&&"metaData",!n.exposes&&"exposes",!n.shared&&"shared"].filter(Boolean);return s.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${s.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:o,origin:this.HostInstance}),s.length>0&&w(Nt,kt,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:s.join(",")},void 0,zt(this.HostInstance.options)),this.manifestCache.set(e,n),n})()}async loadManifestSnapshot(e,t,o,r){return this.manifestLoading[e]||(this.manifestLoading[e]=(async()=>{const n=await this.getManifestJson(e,t,o,r),s=function(e,t={}){const{remotes:o={},overrides:r={},version:n}=t;let s;const i=()=>"publicPath"in e.metaData?"auto"!==e.metaData.publicPath&&""!==e.metaData.publicPath||!n?e.metaData.publicPath:n.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"):e.metaData.getPublicPath,a=Object.keys(r);let c={};Object.keys(o).length||(c=e.remotes?.reduce(((e,t)=>{let o;const n=t.federationContainerName;return o=a.includes(n)?r[n]:"version"in t?t.version:t.entry,e[n]={matchedVersion:o},e}),{})||{}),Object.keys(o).forEach((e=>c[e]={matchedVersion:a.includes(e)?r[e]:o[e]}));const{remoteEntry:{path:l,name:h,type:m},types:u={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:d},globalName:f,ssrRemoteEntry:p}=e.metaData,{exposes:y}=e;let g={version:n||"",buildVersion:d,globalName:f,remoteEntry:so(l,h),remoteEntryType:m,remoteTypes:so(u.path,u.name),remoteTypesZip:u.zip||"",remoteTypesAPI:u.api||"",remotesInfo:c,shared:e?.shared.map((e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]}))),modules:y?.map((e=>({moduleName:e.name,modulePath:e.path,assets:e.assets})))};if("publicPath"in e.metaData?(s={...g,publicPath:i()},"string"==typeof e.metaData.ssrPublicPath&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...g,getPublicPath:i()},p){const e=so(p.path,p.name);s.ssrRemoteEntry=e,s.ssrRemoteEntryType=p.type||"commonjs-module"}return s}(n,{version:e}),{remoteSnapshot:i}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:n,remoteSnapshot:s,manifestUrl:e,from:"manifest"});return i})().then((e=>e))),this.manifestLoading[e]}},fo=class{constructor(){this.hooks=new Jt({})}},po=class{constructor(e){this.hooks=new Jt({beforeRegisterShare:new Qt("beforeRegisterShare"),afterResolve:new eo("afterResolve"),beforeLoadShare:new eo("beforeLoadShare"),loadShare:new ro,afterLoadShare:new Yt("afterLoadShare"),errorLoadShare:new Yt("errorLoadShare"),resolveShare:new Qt("resolveShare"),initContainerShareScopeMap:new Qt("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:o,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:o,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){$(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:o,error:r,recovered:n}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:n})}catch(e){$(e)}}registerShared(e,t){const{newShareInfos:o,allShareInfos:r}=De(e,t);return Object.keys(o).forEach((e=>{o[e].forEach((o=>{o.scope.forEach((r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:o}),this.shareScopeMap[r]?.[e]||this.setShared({pkgName:e,lib:o.lib,get:o.get,loaded:o.loaded||Boolean(o.lib),shared:o,from:t.name})}))}))})),{newShareInfos:o,allShareInfos:r}}async loadShare(e,t){const{host:o}=this,r=Ke({pkgName:e,extraOptions:t,shareInfos:o.options.shared});let n=r;try{r?.scope&&await Promise.all(r.scope.map((async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))}))),n=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:o.options.shared,origin:o})).shareInfo,I(n,`Cannot find shared "${e}" in host "${o.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const s=n,{shared:i,useTreesShaking:a}=qe(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(i){const t=Je(i,a);if(t.lib)return Ze(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),t.lib;if(t.loading&&!t.loaded){const r=await t.loading;return t.loaded=!0,t.lib||(t.lib=r),Ze(t,o.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),r}{const r=async()=>{const e=await t.get();return Ze(t,o.options.name),t.loaded=!0,t.lib=e,e},n=r();this.setShared({pkgName:e,loaded:!1,shared:i,from:o.options.name,lib:null,loading:n,treeShaking:a?t:void 0});const c=await n;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:i}),c}}{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,recovered:!0}),!1;const r=je(s.treeShaking),n=Je(s,r),i=async()=>{const t=await n.get();n.lib=t,n.loaded=!0,Ze(n,o.options.name);const{shared:r,useTreesShaking:i}=qe(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(r){const e=Je(r,i);e.lib=t,e.loaded=!0,r.from=s.from}return t},a=i();this.setShared({pkgName:e,loaded:!1,shared:s,from:o.options.name,lib:null,loading:a,treeShaking:r?n:void 0});const c=await a;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,selectedShared:s}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:n,error:t}),t}}initializeSharing(e=W,t){const{host:o}=this,r=t?.from,n=t?.strategy;let s=t?.initScope;const i=[];if("build"!==r){const{initTokens:t}=this;s||(s=[]);let o=t[e];if(o||(o=t[e]={from:this.host.name}),s.indexOf(o)>=0)return i;s.push(o)}const a=this.shareScopeMap,c=o.options.name;a[e]||(a[e]={});const l=a[e];return Object.keys(o.options.shared).forEach((t=>{o.options.shared[t].forEach((o=>{o.scope.includes(e)&&((e,t)=>{const{version:o,eager:r}=t;l[e]=l[e]||{};const n=l[e],s=n[o]&&Je(n[o]),i=Boolean(s&&("eager"in s&&s.eager||"shareConfig"in s&&s.shareConfig?.eager));(!s||"loaded-first"!==s.strategy&&!s.loaded&&(Boolean(!r)!==!i?r:c>n[o].from))&&(n[o]=t)})(t,o)}))})),"version-first"!==o.options.shareStrategy&&"version-first"!==n||o.options.remotes.forEach((t=>{t.shareScope===e&&i.push((async e=>{const{module:t}=await o.remoteHandler.getRemoteModuleAndOptions({id:e});let r;try{r=await t.getEntry()}catch(n){if(r=await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:"runtime",lifecycle:"beforeLoadShare",remote:t.remoteInfo,origin:o}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,s))}})(t.name))})),i}loadShareSync(e,t){const{host:o}=this,r=Ke({pkgName:e,extraOptions:t,shareInfos:o.options.shared});try{r?.scope&&r.scope.forEach((e=>{this.initializeSharing(e,{strategy:r.strategy})}));const{shared:n}=qe(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(n){if("function"==typeof n.lib)return Ze(n,o.options.name),n.loaded||(n.loaded=!0,n.from===o.options.name&&(r.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),n.lib;if("function"==typeof n.get){const t=n.get();if(!(t instanceof Promise))return Ze(n,o.options.name),this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:t,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:n}),t}}if(r.lib)return r.loaded||(r.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib;if(r.get){const n=r.get();return n instanceof Promise&&w("build"===t?.from?gt:Et,kt,{hostName:o.options.name,sharedPkgName:e},void 0,zt(o.options)),r.lib=n,this.setShared({pkgName:e,loaded:!0,from:o.options.name,lib:r.lib,shared:r}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,selectedShared:r}),r.lib}w(Et,kt,{hostName:o.options.name,sharedPkgName:e},void 0,zt(o.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:r,error:t}),t}}initShareScopeMap(e,t,o={}){const{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:o.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:o,lib:r,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...h}=t;(Array.isArray(l)?l:[l]).forEach((t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][c]||(this.shareScopeMap[t][e][c]={version:c,scope:[t],...h,lib:r});const l=this.shareScopeMap[t][e][c];(e=>{const t=(e,t,o)=>{o&&!e[t]&&(e[t]=o)},o=a?e.treeShaking:e;t(o,"loaded",s),t(o,"loading",n),t(o,"get",i)})(l),o&&l.from!==o&&(l.from=o)}))}_setGlobalShareScopeMap(e){const t=ze(),o=e.id||e.name;o&&!t[o]&&(t[o]=this.shareScopeMap)}},yo=class{constructor(){this.shareScopeMap={},this.hooks=new Jt({afterResolve:new eo("afterResolve")})}registerShared(){return{newShareInfos:{},allShareInfos:{}}}loadShare(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}loadShareSync(){throw new Error("Shared dependency loading is disabled by experiments.optimization.disableShared.")}initializeSharing(){return[]}initShareScopeMap(e,t){this.shareScopeMap[e]=t}},go=class{constructor(e){this.hooks=new Jt({beforeRegisterRemote:new Qt("beforeRegisterRemote"),registerRemote:new Qt("registerRemote"),beforeRequest:new eo("beforeRequest"),afterMatchRemote:new ro("afterMatchRemote"),onLoad:new ro("onLoad"),afterLoadRemote:new ro("afterLoadRemote"),handlePreloadModule:new Yt("handlePreloadModule"),errorLoadRemote:new ro("errorLoadRemote"),beforePreloadRemote:new ro("beforePreloadRemote"),generatePreloadAssets:new ro("generatePreloadAssets"),afterPreloadRemote:new ro("afterPreloadRemote"),loadEntry:new ro}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce(((e,t)=>(this.registerRemote(t,e,{force:!1}),e)),e.remotes)}setIdToRemoteMap(e,t){const{remote:o,expose:r}=t,{name:n,alias:s}=o;if(this.idToRemoteMap[e]={name:o.name,expose:r},s&&e.startsWith(n)){const t=e.replace(n,s);this.idToRemoteMap[t]={name:o.name,expose:r}}else if(s&&e.startsWith(s)){const t=e.replace(s,n);this.idToRemoteMap[t]={name:o.name,expose:r}}}async loadRemote(e,t){const{host:o}=this,r=Ct(o.options.remotes,e);let n,s=e,i=r?.expose,a=r?Dt(r.remote):void 0;try{const{loadFactory:r=!0}=t||{loadFactory:!0},{module:c,moduleOptions:l,remoteMatchInfo:h}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:m,remote:u,expose:d,id:f,remoteSnapshot:p}=h;s=f,i=d,a=Dt(u);const y=await c.get(f,d,t,p),g=await this.hooks.lifecycle.onLoad.emit({id:f,pkgNameOrAlias:m,expose:d,exposeModule:r?y:void 0,exposeModuleFactory:r?void 0:y,remote:u,options:l,moduleInstance:c,origin:o});return this.setIdToRemoteMap(e,h),n={id:s,expose:i,remote:a,options:t,origin:o},"function"==typeof g?g:y}catch(r){const{from:c="runtime"}=t||{from:"runtime"};let l;try{l=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:c,lifecycle:"onLoad",expose:i,remote:a,origin:o})}catch(e){throw n={id:s,expose:i,remote:a,options:t,error:e,origin:o},e}if(!l)throw n={id:s,expose:i,remote:a,options:t,error:r,origin:o},r;return n={id:s,expose:i,remote:a,options:t,error:r,origin:o,recovered:!0},l}finally{n&&await this.hooks.lifecycle.afterLoadRemote.emit(n)}}async preloadRemote(e){const{host:t}=this,o=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=(n=t.options.remotes,e.map((e=>{const t=function(e,t){for(const o of e){if(t===o.name)return o;if(o.alias&&t===o.alias)return o}}(n,e.nameOrAlias);return I(t,`Unable to preload ${e.nameOrAlias} as it is not included in ${!t&&et({remoteInfo:t,remotes:n})}`),{remote:t,preloadConfig:Ht(e)}})));var n;let s;await Promise.all(r.flatMap((e=>{const{preloadConfig:t,remote:o}=e,r=t.exposes||[];return r.length?r.map((r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:jt(o.name,r)}))):[{ops:e,id:`${o.name}/*`}]})).map((async e=>{const{ops:r,id:n}=e,{remote:s,preloadConfig:i}=r,a=Dt(s);try{const{globalSnapshot:e,remoteSnapshot:c}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:s,id:n,initiator:"preloadRemote"}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:s,remoteInfo:a,globalSnapshot:e,remoteSnapshot:c});if(!l)return;const h=await Wt(a,t,l,!0,{initiator:"preloadRemote",id:n});o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:h})}catch(e){o.push({remote:s,remoteInfo:a,preloadConfig:i,id:n,results:[{url:a.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(a.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:n,error:e}]})}})));const i=o.flatMap((e=>e.results.filter((e=>"error"===e.status||"timeout"===e.status))));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:o,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:o,error:s}),s)throw s}registerRemotes(e,t){const{host:o}=this;e.forEach((e=>{this.registerRemote(e,o.options.remotes,{force:t?.force})}))}initRawContainer(e,t,o){const{host:r}=this,n=new Zt({host:r,remoteInfo:Dt({name:e,entry:t})});return n.remoteEntryExports=o,r.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:o}=e;let r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:o,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:o,options:t.options,origin:t,from:"runtime",error:e,lifecycle:"beforeRequest"}),!r)throw e}const{id:n}=r,s=Ct(t.options.remotes,n);if(!s)try{w(yt,kt,{hostName:t.options.name,requestId:n},void 0,zt(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:e,origin:t}),e}const{remote:i}=s,a=Dt(i);await this.hooks.lifecycle.afterMatchRemote.emit({id:n,...s,options:t.options,remoteInfo:a,origin:t});const c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:n,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:h}=c;I(l&&h,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let m=t.moduleCache.get(l.name);const u={host:t,remoteInfo:a};return m||(m=new Zt(u),t.moduleCache.set(l.name,m)),{module:m,moduleOptions:u,remoteMatchInfo:c}}registerRemote(e,t,o){const{host:r}=this,n=()=>{if(e.alias){const o=t.find((t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias))));I(!o,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${o&&o.name} name or alias`)}"entry"in e&&h&&"undefined"!=typeof window&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=W),e.type||(e.type=q)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});const s=t.find((t=>t.name===e.name));if(s){const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];o?.force&&(this.removeRemote(s),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),Qe(i.join(" ")))}else n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r})}removeRemote(e){try{const{host:t}=this,{name:o}=e,r=t.options.remotes.findIndex((e=>e.name===o));-1!==r&&t.options.remotes.splice(r,1);const n=H(x.__FEDERATION__.moduleInfo,N(e)).key;delete x.__FEDERATION__.moduleInfo[n],"entry"in e&&(t.snapshotHandler.manifestCache.delete(e.entry),delete L.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:s}=mo(e,t);if(s){const t=s&&"remotesInfo"in s&&s.remotesInfo&&H(s.remotesInfo,e.name).key;t&&delete s.remotesInfo[t]}const i=t.moduleCache.get(e.name);if(i){const o=i.remoteInfo,r=o.entryGlobalName;x[r]&&(Object.getOwnPropertyDescriptor(x,r)?.configurable?delete x[r]:x[r]=void 0);const n=Lt(i.remoteInfo);j[n]&&delete j[n];let s=o.buildVersion?Ye(o.name,o.buildVersion):o.name;const a=x.__FEDERATION__.__INSTANCES__.findIndex((e=>o.buildVersion?e.options.id===s:e.name===s));if(-1!==a){const e=x.__FEDERATION__.__INSTANCES__[a];s=e.options.id||s;const t=ze();let r=!0;const n=[];Object.keys(t).forEach((e=>{const s=t[e];s&&Object.keys(s).forEach((t=>{const i=s[t];i&&Object.keys(i).forEach((s=>{const a=i[s];a&&Object.keys(a).forEach((i=>{const c=a[i];c&&"object"==typeof c&&c.from===o.name&&(c.loaded||c.loading?(c.useIn=c.useIn.filter((e=>e!==o.name)),c.useIn.length?r=!1:n.push([e,t,s,i])):n.push([e,t,s,i]))}))}))}))})),r&&(e.shareScopeMap={},delete t[s]),n.forEach((([e,o,r,n])=>{delete t[e]?.[o]?.[r]?.[n]})),x.__FEDERATION__.__INSTANCES__.splice(a,1)}t.moduleCache.delete(e.name)}}catch(e){b.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}};const Eo="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN||!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN,So="boolean"!=typeof FEDERATION_OPTIMIZE_NO_REMOTE||!FEDERATION_OPTIMIZE_NO_REMOTE,_o="boolean"!=typeof FEDERATION_OPTIMIZE_NO_SHARED||!FEDERATION_OPTIMIZE_NO_SHARED;var bo=class{constructor(e){this.hooks=new Jt({beforeInit:new Qt("beforeInit"),init:new Yt,beforeInitContainer:new eo("beforeInitContainer"),initContainer:new eo("initContainer")}),this.version="2.8.2",this.moduleCache=new Map,this.loaderHook=new Jt({getModuleInfo:new Yt,createScript:new Yt,createLink:new Yt,fetch:new ro,loadEntryError:new ro,afterLoadEntry:new ro("afterLoadEntry"),beforeInitRemote:new ro("beforeInitRemote"),afterInitRemote:new ro("afterInitRemote"),beforeGetExpose:new ro("beforeGetExpose"),afterGetExpose:new ro("afterGetExpose"),beforeExecuteFactory:new ro("beforeExecuteFactory"),afterExecuteFactory:new ro("afterExecuteFactory"),getModuleFactory:new ro}),this.bridgeHook=new Jt({beforeBridgeRender:new Yt,afterBridgeRender:new Yt,beforeBridgeDestroy:new Yt,afterBridgeDestroy:new Yt});const t=So&&Eo?[{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:o,expose:r,origin:n,remoteInfo:s,id:i}=e;if(!v(t)||!R(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:jt(t.name,r)});no(s,a);const l={remote:t,preloadConfig:{nameOrAlias:o,exposes:[r],resourceCategory:"sync",share:!1,depsRemote:!1}},h=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});return h&&Wt(s,n,h,!1,{initiator:"loadRemote",id:i}).catch((()=>{})),{...e,remoteSnapshot:a}}return e}},{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:o,remoteInfo:r,remote:n,globalSnapshot:s,remoteSnapshot:i}=e;return h?v(n)&&R(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:r.name,entry:n.entry,type:r.type||"global",entryGlobalName:"",shareScope:""}}]}:(no(r,i),ho(t,o,r,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}]:[],o={id:"undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"",name:e.name,plugins:t,remotes:[],shared:{},inBrowser:h};this.name=e.name,this.options=o,this.snapshotHandler=So?new uo(this):new fo,this.sharedHandler=_o?new po(this):new yo,this.remoteHandler=So?new go(this):new oo,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...o.plugins,...e.plugins||[]]),this.options=this.formatOptions(o,e)}initOptions(e){e.name&&e.name!==this.options.name&&w(S(It,kt)),this.registerPlugins(e.plugins);const t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=W,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,o){return this.remoteHandler.initRawContainer(e,t,o)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,o={}){this.sharedHandler.initShareScopeMap(e,t,o)}formatOptions(e,t){const o=_o?De(e,t).allShareInfos:{},{userOptions:r,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:o}),s=this.remoteHandler.formatAndRegisterRemote(n,r),{allShareInfos:i}=this.sharedHandler.registerShared(n,r),a=[...n.plugins];r.plugins&&r.plugins.forEach((e=>{a.includes(e)||a.push(e)}));const c={...e,...t,plugins:a,remotes:s,shared:i,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const t=function(e,t){const o=M.__FEDERATION__.__GLOBAL_PLUGIN__,r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return o.length>0&&o.forEach((t=>{e?.find((e=>e.name!==t.name))&&e.push(t)})),e&&e.length>0&&e.forEach((e=>{r.forEach((o=>{o.applyPlugin(e,t)}))})),e}(e,this);this.options.plugins=this.options.plugins.reduce(((e,t)=>t?(e&&!e.find((e=>e.name===t.name))&&e.push(t),e):e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};Object.defineProperty,"boolean"==typeof FEDERATION_OPTIMIZE_NO_REMOTE&&FEDERATION_OPTIMIZE_NO_REMOTE;let Io=null;function wo(e){const t=function(e,t){const o="undefined"!=typeof FEDERATION_BUILD_IDENTIFIER?FEDERATION_BUILD_IDENTIFIER:"";return x.__FEDERATION__.__INSTANCES__.find((r=>!(!o||r.options.id!==o)||r.options.name===e&&!r.options.version&&!t||!(r.options.name!==e||!t||r.options.version!==t)))}(e.name,e.version),o={...e,id:e.id||""};return t?(t.initOptions(o),Io||(Io=t),t):(Io=function(e){const t=new(x.__FEDERATION__.__DEBUG_CONSTRUCTOR__||bo)({id:`${e.name}@${e.version||Date.now()}`,...e});return function(e){x.__FEDERATION__.__INSTANCES__.push(e)}(t),t}(o),Io)}!function(e,t=d()){t&&(x.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,x.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.8.2")}(bo);let $o=!1;const No=new Set,vo=async(e,t,o,r="default")=>{console.debug(`loading Appshell component: { scope: ${e}, module: ${t}, shareScope: ${r} }`),$o||($o=!0,Io||wo({name:"Appshell",remotes:[]})),No.has(e)||(No.add(e),function(...e){I(Io,bt,kt),Io.registerRemotes.apply(Io,e)}([{name:e,entry:o}]));const n=t.replace(/^\.\//,""),s=await function(...e){return I(Io,bt,kt),Io.loadRemote.apply(Io,e)}(`${e}/${n}`);if(!s)throw new Error(`Failed to find module container ${e}`);return console.debug(`Appshell component loaded: { scope: ${e}, module: ${t}, shareScope: ${r} }`),s.default};(Object.getOwnPropertyDescriptor(vo,"name")||{}).writable||Object.defineProperty(vo,"name",{value:"default",configurable:!0});const Ro=(e={})=>{const t=e.composition??("undefined"==typeof window?void 0:window.__appshell_config__),o=e.resolver??((...e)=>async t=>{for(const o of e){const e=await o(t);if(e)return e}})((e=>async t=>{const o=e?.remotes[t];if(e&&o)return{remote:o,vars:e.vars[o.scope]??{}}})(t),((e,t="")=>async o=>{if(!e)return;const r=`${t}/v1/applications/${e.applicationId}/remotes/${o}`,n=await fetch(r,{credentials:"include"});if(!n.ok)return;const s=await n.json();return{remote:s,vars:e.vars[s.scope]??{}}})(t));return async e=>{const t=t=>new Error(`Failed to load component '${e}'. ${t?.toString()}`);let r;try{r=await o(e)}catch(e){throw t(e)}if(!r)throw new Error(`Remote resource not found in registry. Expected: ${e}`);const{remote:n,vars:s}=r;try{return(0,i.setVars)(n.scope,s),[await vo(n.scope,n.module,n.remoteEntryUrl,n.shareScope),n]}catch(e){throw t(e)}}};(Object.getOwnPropertyDescriptor(Ro,"name")||{}).writable||Object.defineProperty(Ro,"name",{value:"default",configurable:!0});const ko=Ro;var Oo=n(155),To=n.n(Oo);const Ao=(0,Oo.createContext)(void 0),xo=({remote:e,children:t})=>To().createElement(Ao.Provider,{value:e},t);xo.defaultProps={remote:void 0},Ao.Consumer;const Mo=Ao,Lo=({remote:e,reason:t})=>To().createElement("div",{style:{border:"3px solid red"}},To().createElement("h5",null,`Error loading Appshell component '${e}.'`),To().createElement("span",{style:{fontSize:"1rem"}},t)),Po=({remote:e,fallback:t,...o})=>{const[r,n]=(0,Oo.useState)();return(0,Oo.useEffect)((()=>{let t=!1;const r=ko();return n(void 0),async function(){try{const[s,i]=await r(e);if(t||!s)return;n(To().createElement(xo,{remote:i},To().createElement(s,o)))}catch(o){t||n(To().createElement(Lo,{remote:e,reason:`${o}`}))}}(),()=>{t=!0}}),[e,...Object.values(o)]),console.debug(`rendering RemoteSlot[${e}], loading=${!r}`),To().createElement(To().Fragment,null,r||t)};Po.defaultProps={fallback:void 0};const Do=Po,jo=()=>To().useContext(Mo);(Object.getOwnPropertyDescriptor(jo,"name")||{}).writable||Object.defineProperty(jo,"name",{value:"default",configurable:!0});const Co=e=>{let t,o="pending";const r=fetch(e,{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((e=>{if(e.ok)return e.json().then((e=>{o="success",t=e}));o="error",t=new Error(`${e.status} ${e.statusText} ${e.url}`)}));return{read(){if("pending"===o)throw r;if("error"===o)throw t;if("success"===o)return t}}};return(Object.getOwnPropertyDescriptor(Co,"name")||{}).writable||Object.defineProperty(Co,"name",{value:"default",configurable:!0}),s})()));
|