@module-federation/bridge-vue3 0.0.0-perf-devtools-20260108034446 → 0.0.0-perf-website-code-usage-20260914033703
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/create.d.ts +28 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.ts +4 -60
- package/dist/index.js +2867 -1929
- package/dist/provider.d.ts +28 -0
- package/dist/remoteApp.d.ts +18 -0
- package/dist/routeUtils.d.ts +21 -0
- package/dist/utils.d.ts +1 -0
- package/package.json +12 -18
- package/CHANGELOG.md +0 -769
- package/project.json +0 -15
- package/src/assets/vue.svg +0 -1
- package/src/components/HelloWorld.vue +0 -38
- package/src/create.ts +0 -79
- package/src/index.ts +0 -3
- package/src/provider.ts +0 -100
- package/src/remoteApp.tsx +0 -115
- package/src/routeUtils.ts +0 -139
- package/src/style.css +0 -79
- package/src/utils.ts +0 -3
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -41
- package/tsconfig.node.json +0 -11
- package/vite.config.ts +0 -30
package/dist/create.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type AsyncComponentOptions } from 'vue';
|
|
2
|
+
export declare function createRemoteAppComponent(info: {
|
|
3
|
+
loader: () => Promise<any>;
|
|
4
|
+
export?: string;
|
|
5
|
+
asyncComponentOptions?: Omit<AsyncComponentOptions, 'loader'>;
|
|
6
|
+
rootAttrs?: Record<string, unknown>;
|
|
7
|
+
memoryRoute?: {
|
|
8
|
+
entryPath: string;
|
|
9
|
+
};
|
|
10
|
+
hashRoute?: boolean;
|
|
11
|
+
}): {
|
|
12
|
+
render(): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated createRemoteComponent is deprecated, please use createRemoteAppComponent instead!
|
|
18
|
+
*/
|
|
19
|
+
export declare function createRemoteComponent(info: {
|
|
20
|
+
loader: () => Promise<any>;
|
|
21
|
+
export?: string;
|
|
22
|
+
asyncComponentOptions?: Omit<AsyncComponentOptions, 'loader'>;
|
|
23
|
+
rootAttrs?: Record<string, unknown>;
|
|
24
|
+
}): {
|
|
25
|
+
render(): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),
|
|
3
|
-
${
|
|
4
|
-
`)}`:void 0}catch{return}}class
|
|
5
|
-
})`,{filename,importModuleDynamically:((
|
|
6
|
-
${
|
|
7
|
-
`)},runtimeDescMap={[RUNTIME_001]:"Failed to get remoteEntry exports.",[RUNTIME_002]:'The remote entry interface does not contain "init"',[RUNTIME_003]:"Failed to get manifest.",[RUNTIME_004]:"Failed to locate remote.",[RUNTIME_005]:"Invalid loadShareSync function call from bundler runtime",[RUNTIME_006]:"Invalid loadShareSync function call from runtime",[RUNTIME_007]:"Failed to get remote snapshot.",[RUNTIME_008]:"Failed to load script resources.",[RUNTIME_009]:"Please call createInstance first."},LOG_CATEGORY="[ Federation Runtime ]",logger=createLogger(LOG_CATEGORY);function assert(r,t){r||error(t)}function error(r){throw r instanceof Error?(r.message.startsWith(LOG_CATEGORY)||(r.message=`${LOG_CATEGORY}: ${r.message}`),r):new Error(`${LOG_CATEGORY}: ${r}`)}function warn(r){r instanceof Error&&(r.message.startsWith(LOG_CATEGORY)||(r.message=`${LOG_CATEGORY}: ${r.message}`)),logger.warn(r)}function addUniqueItem(r,t){return r.findIndex(o=>o===t)===-1&&r.push(t),r}function getFMId(r){return"version"in r&&r.version?`${r.name}:${r.version}`:"entry"in r&&r.entry?`${r.name}:${r.entry}`:`${r.name}`}function isRemoteInfoWithEntry(r){return typeof r.entry<"u"}function isPureRemoteEntry(r){return!r.entry.includes(".json")}function isObject(r){return r&&typeof r=="object"}const objectToString=Object.prototype.toString;function isPlainObject(r){return objectToString.call(r)==="[object Object]"}function arrayOptions(r){return Array.isArray(r)?r:[r]}function getRemoteEntryInfoFromSnapshot(r){const t={url:"",type:"global",globalName:""};return isBrowserEnv()||isReactNativeEnv()?"remoteEntry"in r?{url:r.remoteEntry,type:r.remoteEntryType,globalName:r.globalName}:t:"ssrRemoteEntry"in r?{url:r.ssrRemoteEntry||t.url,type:r.ssrRemoteEntryType||t.type,globalName:r.globalName}:t}const processModuleAlias=(r,t)=>{let o;return r.endsWith("/")?o=r.slice(0,-1):o=r,t.startsWith(".")&&(t=t.slice(1)),o=o+t,o},CurrentGlobal=typeof globalThis=="object"?globalThis:window,nativeGlobal=(()=>{try{return document.defaultView}catch{return CurrentGlobal}})(),Global=nativeGlobal;function definePropertyGlobalVal(r,t,o){Object.defineProperty(r,t,{value:o,configurable:!1,writable:!0})}function includeOwnProperty(r,t){return Object.hasOwnProperty.call(r,t)}includeOwnProperty(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__")||definePropertyGlobalVal(CurrentGlobal,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(r){var t,o,n,s,i,c;includeOwnProperty(r,"__VMOK__")&&!includeOwnProperty(r,"__FEDERATION__")&&definePropertyGlobalVal(r,"__FEDERATION__",r.__VMOK__),includeOwnProperty(r,"__FEDERATION__")||(definePropertyGlobalVal(r,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),definePropertyGlobalVal(r,"__VMOK__",r.__FEDERATION__)),(t=r.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(o=r.__FEDERATION__).__INSTANCES__??(o.__INSTANCES__=[]),(n=r.__FEDERATION__).moduleInfo??(n.moduleInfo={}),(s=r.__FEDERATION__).__SHARE__??(s.__SHARE__={}),(i=r.__FEDERATION__).__MANIFEST_LOADING__??(i.__MANIFEST_LOADING__={}),(c=r.__FEDERATION__).__PRELOADED_MAP__??(c.__PRELOADED_MAP__=new Map)}setGlobalDefaultVal(CurrentGlobal);setGlobalDefaultVal(nativeGlobal);function setGlobalFederationConstructor(r,t=isDebugMode()){t&&(CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__=r,CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.0.0-perf-devtools-20260108034446")}function getInfoWithoutType(r,t){if(typeof t=="string"){if(r[t])return{value:r[t],key:t};{const n=Object.keys(r);for(const s of n){const[i,c]=s.split(":"),a=`${i}:${t}`,l=r[a];if(l)return{value:l,key:a}}return{value:void 0,key:t}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(r,t)=>{const o=getFMId(r),n=getInfoWithoutType(t,o).value;if(n&&!n.version&&"version"in r&&r.version&&(n.version=r.version),n)return n;if("version"in r&&r.version){const{version:s,...i}=r,c=getFMId(i),a=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,c).value;if((a==null?void 0:a.version)===s)return a}},getGlobalSnapshotInfoByModuleInfo=r=>getTargetSnapshotInfoByModuleInfo(r,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(r,t)=>{const o=getFMId(r);return nativeGlobal.__FEDERATION__.moduleInfo[o]=t,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=r=>(nativeGlobal.__FEDERATION__.moduleInfo={...nativeGlobal.__FEDERATION__.moduleInfo,...r},()=>{const t=Object.keys(r);for(const o of t)delete nativeGlobal.__FEDERATION__.moduleInfo[o]}),getRemoteEntryExports=(r,t)=>{const o=t||`__FEDERATION_${r}:custom__`,n=CurrentGlobal[o];return{remoteEntryKey:o,entryExports:n}},getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__,getPreloaded=r=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(r),setPreloaded=r=>CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(r,!0),DEFAULT_SCOPE="default",DEFAULT_REMOTE_TYPE="global",buildIdentifier="[0-9A-Za-z-]+",build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`,numericIdentifier="0|[1-9]\\d*",numericIdentifierLoose="[0-9]+",nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*",preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`,preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`,preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`,preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`,xRangeIdentifier=`${numericIdentifier}|x|X|\\*`,xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`,hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`,mainVersionLoose=`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`,loosePlain=`[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`,gtlt="((?:<|>)?=?)",comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`,loneTilde="(?:~>?)",tildeTrim=`(\\s*)${loneTilde}\\s+`,loneCaret="(?:\\^)",caretTrim=`(\\s*)${loneCaret}\\s+`,star="(<|>)?=?\\s*\\*",caret=`^${loneCaret}${xRangePlain}$`,mainVersion=`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`,fullPlain=`v?${mainVersion}${preRelease}?${build}?`,tilde=`^${loneTilde}${xRangePlain}$`,xRange=`^${gtlt}\\s*${xRangePlain}$`,comparator=`^${gtlt}\\s*(${fullPlain})$|^$`,gte0="^\\s*>=\\s*0.0.0\\s*$";function parseRegex(r){return new RegExp(r)}function isXVersion(r){return!r||r.toLowerCase()==="x"||r==="*"}function pipe(...r){return t=>r.reduce((o,n)=>n(o),t)}function extractComparator(r){return r.match(parseRegex(comparator))}function combineVersion(r,t,o,n){const s=`${r}.${t}.${o}`;return n?`${s}-${n}`:s}function parseHyphen(r){return r.replace(parseRegex(hyphenRange),(t,o,n,s,i,c,a,l,u,d,m,h)=>(isXVersion(n)?o="":isXVersion(s)?o=`>=${n}.0.0`:isXVersion(i)?o=`>=${n}.${s}.0`:o=`>=${o}`,isXVersion(u)?l="":isXVersion(d)?l=`<${Number(u)+1}.0.0-0`:isXVersion(m)?l=`<${u}.${Number(d)+1}.0-0`:h?l=`<=${u}.${d}.${m}-${h}`:l=`<=${l}`,`${o} ${l}`.trim()))}function parseComparatorTrim(r){return r.replace(parseRegex(comparatorTrim),"$1$2$3")}function parseTildeTrim(r){return r.replace(parseRegex(tildeTrim),"$1~")}function parseCaretTrim(r){return r.replace(parseRegex(caretTrim),"$1^")}function parseCarets(r){return r.trim().split(/\s+/).map(t=>t.replace(parseRegex(caret),(o,n,s,i,c)=>isXVersion(n)?"":isXVersion(s)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(i)?n==="0"?`>=${n}.${s}.0 <${n}.${Number(s)+1}.0-0`:`>=${n}.${s}.0 <${Number(n)+1}.0.0-0`:c?n==="0"?s==="0"?`>=${n}.${s}.${i}-${c} <${n}.${s}.${Number(i)+1}-0`:`>=${n}.${s}.${i}-${c} <${n}.${Number(s)+1}.0-0`:`>=${n}.${s}.${i}-${c} <${Number(n)+1}.0.0-0`:n==="0"?s==="0"?`>=${n}.${s}.${i} <${n}.${s}.${Number(i)+1}-0`:`>=${n}.${s}.${i} <${n}.${Number(s)+1}.0-0`:`>=${n}.${s}.${i} <${Number(n)+1}.0.0-0`)).join(" ")}function parseTildes(r){return r.trim().split(/\s+/).map(t=>t.replace(parseRegex(tilde),(o,n,s,i,c)=>isXVersion(n)?"":isXVersion(s)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:isXVersion(i)?`>=${n}.${s}.0 <${n}.${Number(s)+1}.0-0`:c?`>=${n}.${s}.${i}-${c} <${n}.${Number(s)+1}.0-0`:`>=${n}.${s}.${i} <${n}.${Number(s)+1}.0-0`)).join(" ")}function parseXRanges(r){return r.split(/\s+/).map(t=>t.trim().replace(parseRegex(xRange),(o,n,s,i,c,a)=>{const l=isXVersion(s),u=l||isXVersion(i),d=u||isXVersion(c);return n==="="&&d&&(n=""),a="",l?n===">"||n==="<"?"<0.0.0-0":"*":n&&d?(u&&(i=0),c=0,n===">"?(n=">=",u?(s=Number(s)+1,i=0,c=0):(i=Number(i)+1,c=0)):n==="<="&&(n="<",u?s=Number(s)+1:i=Number(i)+1),n==="<"&&(a="-0"),`${n+s}.${i}.${c}${a}`):u?`>=${s}.0.0${a} <${Number(s)+1}.0.0-0`:d?`>=${s}.${i}.0${a} <${s}.${Number(i)+1}.0-0`:o})).join(" ")}function parseStar(r){return r.trim().replace(parseRegex(star),"")}function parseGTE0(r){return r.trim().replace(parseRegex(gte0),"")}function compareAtom(r,t){return r=Number(r)||r,t=Number(t)||t,r>t?1:r===t?0:-1}function comparePreRelease(r,t){const{preRelease:o}=r,{preRelease:n}=t;if(o===void 0&&n)return 1;if(o&&n===void 0)return-1;if(o===void 0&&n===void 0)return 0;for(let s=0,i=o.length;s<=i;s++){const c=o[s],a=n[s];if(c!==a)return c===void 0&&a===void 0?0:c?a?compareAtom(c,a):-1:1}return 0}function compareVersion(r,t){return compareAtom(r.major,t.major)||compareAtom(r.minor,t.minor)||compareAtom(r.patch,t.patch)||comparePreRelease(r,t)}function eq(r,t){return r.version===t.version}function compare(r,t){switch(r.operator){case"":case"=":return eq(r,t);case">":return compareVersion(r,t)<0;case">=":return eq(r,t)||compareVersion(r,t)<0;case"<":return compareVersion(r,t)>0;case"<=":return eq(r,t)||compareVersion(r,t)>0;case void 0:return!0;default:return!1}}function parseComparatorString(r){return pipe(parseCarets,parseTildes,parseXRanges,parseStar)(r)}function parseRange(r){return pipe(parseHyphen,parseComparatorTrim,parseTildeTrim,parseCaretTrim)(r.trim()).split(/\s+/).join(" ")}function satisfy(r,t){if(!r)return!1;const o=extractComparator(r);if(!o)return!1;const[,n,,s,i,c,a]=o,l={operator:n,version:combineVersion(s,i,c,a),major:s,minor:i,patch:c,preRelease:a==null?void 0:a.split(".")},u=t.split("||");for(const d of u){const m=d.trim();if(!m||m==="*"||m==="x")return!0;try{const h=parseRange(m);if(!h.trim())return!0;const p=h.split(" ").map(g=>parseComparatorString(g)).join(" ");if(!p.trim())return!0;const y=p.split(/\s+/).map(g=>parseGTE0(g)).filter(Boolean);if(y.length===0)continue;let R=!0;for(const g of y){const E=extractComparator(g);if(!E){R=!1;break}const[,_,,S,T,b,I]=E,A={operator:_,version:combineVersion(S,T,b,I),major:S,minor:T,patch:b,preRelease:I==null?void 0:I.split(".")};if(!compare(A,l)){R=!1;break}}if(R)return!0}catch(h){console.error(`[semver] Error processing range part "${m}":`,h);continue}}return!1}function formatShare(r,t,o,n){let s;return"get"in r?s=r.get:"lib"in r?s=()=>Promise.resolve(r.lib):s=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${o}'!`)}),{deps:[],useIn:[],from:t,loading:null,...r,shareConfig:{requiredVersion:`^${r.version}`,singleton:!1,eager:!1,strictVersion:!1,...r.shareConfig},get:s,loaded:r!=null&&r.loaded||"lib"in r?!0:void 0,version:r.version??"0",scope:Array.isArray(r.scope)?r.scope:[r.scope??"default"],strategy:(r.strategy??n)||"version-first"}}function formatShareConfigs(r,t){const o=t.shared||{},n=t.name,s=Object.keys(o).reduce((c,a)=>{const l=arrayOptions(o[a]);return c[a]=c[a]||[],l.forEach(u=>{c[a].push(formatShare(u,n,a,t.shareStrategy))}),c},{}),i={...r.shared};return Object.keys(s).forEach(c=>{i[c]?s[c].forEach(a=>{i[c].find(u=>u.version===a.version)||i[c].push(a)}):i[c]=s[c]}),{shared:i,shareInfos:s}}function versionLt(r,t){const o=n=>{if(!Number.isNaN(Number(n))){const i=n.split(".");let c=n;for(let a=0;a<3-i.length;a++)c+=".0";return c}return n};return!!satisfy(o(r),`<=${o(t)}`)}const findVersion=(r,t)=>{const o=t||function(n,s){return versionLt(n,s)};return Object.keys(r).reduce((n,s)=>!n||o(n,s)||n==="0"?s:n,0)},isLoaded=r=>!!r.loaded||typeof r.lib=="function",isLoading=r=>!!r.loading;function findSingletonVersionOrderByVersion(r,t,o){const n=r[t][o],s=function(i,c){return!isLoaded(n[i])&&versionLt(i,c)};return findVersion(r[t][o],s)}function findSingletonVersionOrderByLoaded(r,t,o){const n=r[t][o],s=function(i,c){const a=l=>isLoaded(l)||isLoading(l);return a(n[c])?a(n[i])?!!versionLt(i,c):!0:a(n[i])?!1:versionLt(i,c)};return findVersion(r[t][o],s)}function getFindShareFunction(r){return r==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(r,t,o,n){if(!r)return;const{shareConfig:s,scope:i=DEFAULT_SCOPE,strategy:c}=o,a=Array.isArray(i)?i:[i];for(const l of a)if(s&&r[l]&&r[l][t]){const{requiredVersion:u}=s,m=getFindShareFunction(c)(r,l,t),h=()=>{if(s.singleton){if(typeof u=="string"&&!satisfy(m,u)){const R=`Version ${m} from ${m&&r[l][t][m].from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${u})`;s.strictVersion?error(R):warn(R)}return r[l][t][m]}else{if(u===!1||u==="*"||satisfy(m,u))return r[l][t][m];for(const[R,g]of Object.entries(r[l][t]))if(satisfy(R,u))return g}},p={shareScopeMap:r,scope:l,pkgName:t,version:m,GlobalFederation:Global.__FEDERATION__,resolver:h};return(n.emit(p)||p).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function getTargetSharedOptions(r){const{pkgName:t,extraOptions:o,shareInfos:n}=r,s=c=>{if(!c)return;const a={};c.forEach(d=>{a[d.version]=d});const u=findVersion(a,function(d,m){return!isLoaded(a[d])&&versionLt(d,m)});return a[u]},i=(o==null?void 0:o.resolver)??s;return Object.assign({},i(n[t]),o==null?void 0:o.customShareInfo)}function getBuilderId(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function matchRemoteWithNameAndExpose(r,t){for(const o of r){const n=t.startsWith(o.name);let s=t.replace(o.name,"");if(n){if(s.startsWith("/")){const a=o.name;return s=`.${s}`,{pkgNameOrAlias:a,expose:s,remote:o}}else if(s==="")return{pkgNameOrAlias:o.name,expose:".",remote:o}}const i=o.alias&&t.startsWith(o.alias);let c=o.alias&&t.replace(o.alias,"");if(o.alias&&i){if(c&&c.startsWith("/")){const a=o.alias;return c=`.${c}`,{pkgNameOrAlias:a,expose:c,remote:o}}else if(c==="")return{pkgNameOrAlias:o.alias,expose:".",remote:o}}}}function matchRemote(r,t){for(const o of r)if(t===o.name||o.alias&&t===o.alias)return o}function registerPlugins(r,t){const o=getGlobalHostPlugins(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return o.length>0&&o.forEach(s=>{r!=null&&r.find(i=>i.name!==s.name)&&r.push(s)}),r&&r.length>0&&r.forEach(s=>{n.forEach(i=>{i.applyPlugin(s,t)})}),r}const importCallback=".then(callbacks[0]).catch(callbacks[1])";async function loadEsmEntry({entry:r,remoteEntryExports:t}){return new Promise((o,n)=>{try{t?o(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${r}")${importCallback}`)([o,n]):import(r).then(o).catch(n)}catch(s){n(s)}})}async function loadSystemJsEntry({entry:r,remoteEntryExports:t}){return new Promise((o,n)=>{try{t?o(t):typeof __system_context__>"u"?System.import(r).then(o).catch(n):new Function("callbacks",`System.import("${r}")${importCallback}`)([o,n])}catch(s){n(s)}})}function handleRemoteEntryLoaded(r,t,o){const{remoteEntryKey:n,entryExports:s}=getRemoteEntryExports(r,t);return assert(s,getShortErrorMsg(RUNTIME_001,runtimeDescMap,{remoteName:r,remoteEntryUrl:o,remoteEntryKey:n})),s}async function loadEntryScript({name:r,globalName:t,entry:o,loaderHook:n,getEntryUrl:s}){const{entryExports:i}=getRemoteEntryExports(r,t);if(i)return i;const c=s?s(o):o;return loadScript(c,{attrs:{},createScriptHook:(a,l)=>{const u=n.lifecycle.createScript.emit({url:a,attrs:l});if(u&&(u instanceof HTMLScriptElement||"script"in u||"timeout"in u))return u}}).then(()=>handleRemoteEntryLoaded(r,t,o)).catch(a=>{throw assert(void 0,getShortErrorMsg(RUNTIME_008,runtimeDescMap,{remoteName:r,resourceUrl:o})),a})}async function loadEntryDom({remoteInfo:r,remoteEntryExports:t,loaderHook:o,getEntryUrl:n}){const{entry:s,entryGlobalName:i,name:c,type:a}=r;switch(a){case"esm":case"module":return loadEsmEntry({entry:s,remoteEntryExports:t});case"system":return loadSystemJsEntry({entry:s,remoteEntryExports:t});default:return loadEntryScript({entry:s,globalName:i,name:c,loaderHook:o,getEntryUrl:n})}}async function loadEntryNode({remoteInfo:r,loaderHook:t}){const{entry:o,entryGlobalName:n,name:s,type:i}=r,{entryExports:c}=getRemoteEntryExports(s,n);return c||loadScriptNode(o,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(a,l={})=>{const u=t.lifecycle.createScript.emit({url:a,attrs:l});if(u&&"url"in u)return u}}}).then(()=>handleRemoteEntryLoaded(s,n,o)).catch(a=>{throw a})}function getRemoteEntryUniqueKey(r){const{entry:t,name:o}=r;return composeKeyWithSeparator(o,t)}async function getRemoteEntry(r){const{origin:t,remoteEntryExports:o,remoteInfo:n,getEntryUrl:s,_inErrorHandling:i=!1}=r,c=getRemoteEntryUniqueKey(n);if(o)return o;if(!globalLoading[c]){const a=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;globalLoading[c]=a.emit({loaderHook:l,remoteInfo:n,remoteEntryExports:o}).then(u=>u||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":isBrowserEnv())?loadEntryDom({remoteInfo:n,remoteEntryExports:o,loaderHook:l,getEntryUrl:s}):loadEntryNode({remoteInfo:n,loaderHook:l}))).catch(async u=>{const d=getRemoteEntryUniqueKey(n);if(u instanceof Error&&u.message.includes(RUNTIME_008)&&!i){const h=y=>getRemoteEntry({...y,_inErrorHandling:!0}),p=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:h,origin:t,remoteInfo:n,remoteEntryExports:o,globalLoading,uniqueKey:d});if(p)return p}throw u})}return globalLoading[c]}function getRemoteInfo(r){return{...r,entry:"entry"in r?r.entry:"",type:r.type||DEFAULT_REMOTE_TYPE,entryGlobalName:r.entryGlobalName||r.name,shareScope:r.shareScope||DEFAULT_SCOPE}}function defaultPreloadArgs(r){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...r}}function formatPreloadArgs(r,t){return t.map(o=>{const n=matchRemote(r,o.nameOrAlias);return assert(n,`Unable to preload ${o.nameOrAlias} as it is not included in ${!n&&safeToString({remoteInfo:n,remotes:r})}`),{remote:n,preloadConfig:defaultPreloadArgs(o)}})}function normalizePreloadExposes(r){return r?r.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function preloadAssets(r,t,o,n=!0){const{cssAssets:s,jsAssetsWithoutEntry:i,entryAssets:c}=o;if(t.options.inBrowser){if(c.forEach(a=>{const{moduleInfo:l}=a,u=t.moduleCache.get(r.name);getRemoteEntry(u?{origin:t,remoteInfo:l,remoteEntryExports:u.remoteEntryExports}:{origin:t,remoteInfo:l,remoteEntryExports:void 0})}),n){const a={rel:"preload",as:"style"};s.forEach(l=>{const{link:u,needAttach:d}=createLink({url:l,cb:()=>{},attrs:a,createLinkHook:(m,h)=>{const p=t.loaderHook.lifecycle.createLink.emit({url:m,attrs:h});if(p instanceof HTMLLinkElement)return p}});d&&document.head.appendChild(u)})}else{const a={rel:"stylesheet",type:"text/css"};s.forEach(l=>{const{link:u,needAttach:d}=createLink({url:l,cb:()=>{},attrs:a,createLinkHook:(m,h)=>{const p=t.loaderHook.lifecycle.createLink.emit({url:m,attrs:h});if(p instanceof HTMLLinkElement)return p},needDeleteLink:!1});d&&document.head.appendChild(u)})}if(n){const a={rel:"preload",as:"script"};i.forEach(l=>{const{link:u,needAttach:d}=createLink({url:l,cb:()=>{},attrs:a,createLinkHook:(m,h)=>{const p=t.loaderHook.lifecycle.createLink.emit({url:m,attrs:h});if(p instanceof HTMLLinkElement)return p}});d&&document.head.appendChild(u)})}else{const a={fetchpriority:"high",type:(r==null?void 0:r.type)==="module"?"module":"text/javascript"};i.forEach(l=>{const{script:u,needAttach:d}=createScript({url:l,cb:()=>{},attrs:a,createScriptHook:(m,h)=>{const p=t.loaderHook.lifecycle.createScript.emit({url:m,attrs:h});if(p instanceof HTMLScriptElement)return p},needDeleteScript:!0});d&&document.head.appendChild(u)})}}}class Module{constructor({remoteInfo:t,host:o}){this.inited=!1,this.lib=void 0,this.remoteInfo=t,this.host=o}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const t=await getRemoteEntry({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return assert(t,`remoteEntryExports is undefined
|
|
8
|
-
${safeToString(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(t,o){const n=await this.getEntry();if(!this.inited){const s=this.host.shareScopeMap,i=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];i.length||i.push("default"),i.forEach(d=>{s[d]||(s[d]={})});const c=s[i[0]],a=[],l={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?i:this.remoteInfo.shareScope||"default"};Object.defineProperty(l,"shareScopeMap",{value:s,enumerable:!1});const u=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:c,remoteEntryInitOptions:l,initScope:a,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&error(getShortErrorMsg(RUNTIME_002,runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await n.init(u.shareScope,u.initScope,u.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...u,id:t,remoteSnapshot:o,remoteEntryExports:n})}return n}async get(t,o,n,s){const{loadFactory:i=!0}=n||{loadFactory:!0},c=await this.init(t,s);this.lib=c,this.inited=!0;let a;a=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:c,expose:o,moduleInfo:this.remoteInfo}),a||(a=await c.get(o)),assert(a,`${getFMId(this.remoteInfo)} remote don't export ${o}.`);const l=processModuleAlias(this.remoteInfo.name,o),u=this.wraperFactory(a,l);return i?await u():u}wraperFactory(t,o){function n(s,i){s&&typeof s=="object"&&Object.isExtensible(s)&&!Object.getOwnPropertyDescriptor(s,Symbol.for("mf_module_id"))&&Object.defineProperty(s,Symbol.for("mf_module_id"),{value:i,enumerable:!1})}return t instanceof Promise?async()=>{const s=await t();return n(s,o),s}:()=>{const s=t();return n(s,o),s}}}class SyncHook{constructor(t){this.type="",this.listeners=new Set,t&&(this.type=t)}on(t){typeof t=="function"&&this.listeners.add(t)}once(t){const o=this;this.on(function n(...s){return o.remove(n),t.apply(null,s)})}emit(...t){let o;return this.listeners.size>0&&this.listeners.forEach(n=>{o=n(...t)}),o}remove(t){this.listeners.delete(t)}removeAll(){this.listeners.clear()}}class AsyncHook extends SyncHook{emit(...t){let o;const n=Array.from(this.listeners);if(n.length>0){let s=0;const i=c=>c===!1?!1:s<n.length?Promise.resolve(n[s++].apply(null,t)).then(i):c;o=i()}return Promise.resolve(o)}}function checkReturnData(r,t){if(!isObject(t))return!1;if(r!==t){for(const o in r)if(!(o in t))return!1}return!0}class SyncWaterfallHook extends SyncHook{constructor(t){super(),this.onerror=error,this.type=t}emit(t){isObject(t)||error(`The data for the "${this.type}" hook should be an object.`);for(const o of this.listeners)try{const n=o(t);if(checkReturnData(t,n))t=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){warn(n),this.onerror(n)}return t}}class AsyncWaterfallHook extends SyncHook{constructor(t){super(),this.onerror=error,this.type=t}emit(t){isObject(t)||error(`The response data for the "${this.type}" hook must be an object.`);const o=Array.from(this.listeners);if(o.length>0){let n=0;const s=c=>(warn(c),this.onerror(c),t),i=c=>{if(checkReturnData(t,c)){if(t=c,n<o.length)try{return Promise.resolve(o[n++](t)).then(i,s)}catch(a){return s(a)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return t};return Promise.resolve(i(t))}return Promise.resolve(t)}}class PluginSystem{constructor(t){this.registerPlugins={},this.lifecycle=t,this.lifecycleKeys=Object.keys(t)}applyPlugin(t,o){var s;assert(isPlainObject(t),"Plugin configuration is invalid.");const n=t.name;assert(n,"A name must be provided by the plugin."),this.registerPlugins[n]||(this.registerPlugins[n]=t,(s=t.apply)==null||s.call(t,o),Object.keys(this.lifecycle).forEach(i=>{const c=t[i];c&&this.lifecycle[i].on(c)}))}removePlugin(t){assert(t,"A name is required.");const o=this.registerPlugins[t];assert(o,`The plugin "${t}" is not registered.`),Object.keys(o).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(o[n])})}}function assignRemoteInfo(r,t){const o=getRemoteEntryInfoFromSnapshot(t);o.url||error(`The attribute remoteEntry of ${r.name} must not be undefined.`);let n=getResourceUrl(t,o.url);!isBrowserEnv()&&!n.startsWith("http")&&(n=`https:${n}`),r.type=o.type,r.entryGlobalName=o.globalName,r.entry=n,r.version=t.version,r.buildVersion=t.buildVersion}function snapshotPlugin(){return{name:"snapshot-plugin",async afterResolve(r){const{remote:t,pkgNameOrAlias:o,expose:n,origin:s,remoteInfo:i,id:c}=r;if(!isRemoteInfoWithEntry(t)||!isPureRemoteEntry(t)){const{remoteSnapshot:a,globalSnapshot:l}=await s.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:c});assignRemoteInfo(i,a);const u={remote:t,preloadConfig:{nameOrAlias:o,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},d=await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:s,preloadOptions:u,remoteInfo:i,remote:t,remoteSnapshot:a,globalSnapshot:l});return d&&preloadAssets(i,s,d,!1),{...r,remoteSnapshot:a}}return r}}}function splitId(r){const t=r.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function traverseModuleInfo(r,t,o,n,s={},i){const c=getFMId(t),{value:a}=getInfoWithoutType(r,c),l=i||a;if(l&&!isManifestProvider(l)&&(o(l,t,n),l.remotesInfo)){const u=Object.keys(l.remotesInfo);for(const d of u){if(s[d])continue;s[d]=!0;const m=splitId(d),h=l.remotesInfo[d];traverseModuleInfo(r,{name:m.name,version:h.matchedVersion},o,!1,s,void 0)}}}const isExisted=(r,t)=>document.querySelector(`${r}[${r==="link"?"href":"src"}="${t}"]`);function generatePreloadAssets(r,t,o,n,s){const i=[],c=[],a=[],l=new Set,u=new Set,{options:d}=r,{preloadConfig:m}=t,{depsRemote:h}=m;if(traverseModuleInfo(n,o,(g,E,_)=>{var w;let S;if(_)S=m;else if(Array.isArray(h)){const N=h.find($=>$.nameOrAlias===E.name||$.nameOrAlias===E.alias);if(!N)return;S=defaultPreloadArgs(N)}else if(h===!0)S=m;else return;const T=getResourceUrl(g,getRemoteEntryInfoFromSnapshot(g).url);T&&a.push({name:E.name,moduleInfo:{name:E.name,entry:T,type:"remoteEntryType"in g?g.remoteEntryType:"global",entryGlobalName:"globalName"in g?g.globalName:E.name,shareScope:"",version:"version"in g?g.version:void 0},url:T});let b="modules"in g?g.modules:[];const I=normalizePreloadExposes(S.exposes);I.length&&"modules"in g&&(b=(w=g==null?void 0:g.modules)==null?void 0:w.reduce((N,$)=>((I==null?void 0:I.indexOf($.moduleName))!==-1&&N.push($),N),[]));function A(N){const $=N.map(P=>getResourceUrl(g,P));return S.filter?$.filter(S.filter):$}if(b){const N=b.length;for(let $=0;$<N;$++){const P=b[$],M=`${E.name}/${P.moduleName}`;r.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:P.moduleName==="."?E.name:M,name:E.name,remoteSnapshot:g,preloadConfig:S,remote:E,origin:r}),!getPreloaded(M)&&(S.resourceCategory==="all"?(i.push(...A(P.assets.css.async)),i.push(...A(P.assets.css.sync)),c.push(...A(P.assets.js.async)),c.push(...A(P.assets.js.sync))):(S.resourceCategory="sync")&&(i.push(...A(P.assets.css.sync)),c.push(...A(P.assets.js.sync))),setPreloaded(M))}}},!0,{},s),s.shared&&s.shared.length>0){const g=(E,_)=>{const S=getRegisteredShare(r.shareScopeMap,_.sharedName,E,r.sharedHandler.hooks.lifecycle.resolveShare);S&&typeof S.lib=="function"&&(_.assets.js.sync.forEach(T=>{l.add(T)}),_.assets.css.sync.forEach(T=>{u.add(T)}))};s.shared.forEach(E=>{var b;const _=(b=d.shared)==null?void 0:b[E.sharedName];if(!_)return;const S=E.version?_.find(I=>I.version===E.version):_;if(!S)return;arrayOptions(S).forEach(I=>{g(I,E)})})}const y=c.filter(g=>!l.has(g)&&!isExisted("script",g));return{cssAssets:i.filter(g=>!u.has(g)&&!isExisted("link",g)),jsAssetsWithoutEntry:y,entryAssets:a.filter(g=>!isExisted("script",g.url))}}const generatePreloadAssetsPlugin=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(r){const{origin:t,preloadOptions:o,remoteInfo:n,remote:s,globalSnapshot:i,remoteSnapshot:c}=r;return isBrowserEnv()?isRemoteInfoWithEntry(s)&&isPureRemoteEntry(s)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:s.name,url:s.entry,moduleInfo:{name:n.name,entry:s.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(assignRemoteInfo(n,c),generatePreloadAssets(t,o,n,i,c)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function getGlobalRemoteInfo(r,t){const o=getGlobalSnapshotInfoByModuleInfo({name:t.name,version:t.options.version}),n=o&&"remotesInfo"in o&&o.remotesInfo&&getInfoWithoutType(o.remotesInfo,r.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:o,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:r.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:getGlobalSnapshot(),remoteSnapshot:getGlobalSnapshotInfoByModuleInfo({name:r.name,version:"version"in r?r.version:void 0})}}class SnapshotHandler{constructor(t){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new PluginSystem({beforeLoadRemoteSnapshot:new AsyncHook("beforeLoadRemoteSnapshot"),loadSnapshot:new AsyncWaterfallHook("loadGlobalSnapshot"),loadRemoteSnapshot:new AsyncWaterfallHook("loadRemoteSnapshot"),afterLoadSnapshot:new AsyncWaterfallHook("afterLoadSnapshot")}),this.manifestLoading=Global.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=t,this.loaderHook=t.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:t,id:o,expose:n}){const{options:s}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:s,moduleInfo:t});let i=getGlobalSnapshotInfoByModuleInfo({name:this.HostInstance.options.name,version:this.HostInstance.options.version});i||(i={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},addGlobalSnapshot({[this.HostInstance.options.name]:i})),i&&"remotesInfo"in i&&!getInfoWithoutType(i.remotesInfo,t.name).value&&("version"in t||"entry"in t)&&(i.remotesInfo={...i==null?void 0:i.remotesInfo,[t.name]:{matchedVersion:"version"in t?t.version:t.entry}});const{hostGlobalSnapshot:c,remoteSnapshot:a,globalSnapshot:l}=this.getGlobalRemoteInfo(t),{remoteSnapshot:u,globalSnapshot:d}=await this.hooks.lifecycle.loadSnapshot.emit({options:s,moduleInfo:t,hostGlobalSnapshot:c,remoteSnapshot:a,globalSnapshot:l});let m,h;if(u)if(isManifestProvider(u)){const p=isBrowserEnv()?u.remoteEntry:u.ssrRemoteEntry||u.remoteEntry||"",y=await this.getManifestJson(p,t,{}),R=setGlobalSnapshotInfoByModuleInfo({...t,entry:p},y);m=y,h=R}else{const{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,remoteSnapshot:u,from:"global"});m=p,h=d}else if(isRemoteInfoWithEntry(t)){const p=await this.getManifestJson(t.entry,t,{}),y=setGlobalSnapshotInfoByModuleInfo(t,p),{remoteSnapshot:R}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,remoteSnapshot:p,from:"global"});m=R,h=y}else error(getShortErrorMsg(RUNTIME_007,runtimeDescMap,{hostName:t.name,hostVersion:t.version,globalSnapshot:JSON.stringify(d)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:o,host:this.HostInstance,options:s,moduleInfo:t,remoteSnapshot:m}),{remoteSnapshot:m,globalSnapshot:h}}getGlobalRemoteInfo(t){return getGlobalRemoteInfo(t,this.HostInstance)}async getManifestJson(t,o,n){const s=async()=>{let c=this.manifestCache.get(t);if(c)return c;try{let a=await this.loaderHook.lifecycle.fetch.emit(t,{});(!a||!(a instanceof Response))&&(a=await fetch(t,{})),c=await a.json()}catch(a){c=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:t,error:a,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),c||(delete this.manifestLoading[t],error(getShortErrorMsg(RUNTIME_003,runtimeDescMap,{manifestUrl:t,moduleName:o.name,hostName:this.HostInstance.options.name},`${a}`)))}return assert(c.metaData&&c.exposes&&c.shared,`${t} is not a federation manifest`),this.manifestCache.set(t,c),c},i=async()=>{const c=await s(),a=generateSnapshotFromManifest(c,{version:t}),{remoteSnapshot:l}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:o,manifestJson:c,remoteSnapshot:a,manifestUrl:t,from:"manifest"});return l};return this.manifestLoading[t]||(this.manifestLoading[t]=i().then(c=>c)),this.manifestLoading[t]}}class SharedHandler{constructor(t){this.hooks=new PluginSystem({afterResolve:new AsyncWaterfallHook("afterResolve"),beforeLoadShare:new AsyncWaterfallHook("beforeLoadShare"),loadShare:new AsyncHook,resolveShare:new SyncWaterfallHook("resolveShare"),initContainerShareScopeMap:new SyncWaterfallHook("initContainerShareScopeMap")}),this.host=t,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(t.options)}registerShared(t,o){const{shareInfos:n,shared:s}=formatShareConfigs(t,o);return Object.keys(n).forEach(c=>{n[c].forEach(l=>{l.scope.forEach(u=>{var m;((m=this.shareScopeMap[u])==null?void 0:m[c])||this.setShared({pkgName:c,lib:l.lib,get:l.get,loaded:l.loaded||!!l.lib,shared:l,from:o.name})})})}),{shareInfos:n,shared:s}}async loadShare(t,o){const{host:n}=this,s=getTargetSharedOptions({pkgName:t,extraOptions:o,shareInfos:n.options.shared});s!=null&&s.scope&&await Promise.all(s.scope.map(async u=>{await Promise.all(this.initializeSharing(u,{strategy:s.strategy}))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:t,shareInfo:s,shared:n.options.shared,origin:n}),{shareInfo:c}=i;assert(c,`Cannot find ${t} Share in the ${n.options.name}. Please ensure that the ${t} Share parameters have been injected`);const a=getRegisteredShare(this.shareScopeMap,t,c,this.hooks.lifecycle.resolveShare),l=u=>{u.useIn||(u.useIn=[]),addUniqueItem(u.useIn,n.options.name)};if(a&&a.lib)return l(a),a.lib;if(a&&a.loading&&!a.loaded){const u=await a.loading;return a.loaded=!0,a.lib||(a.lib=u),l(a),u}else if(a){const d=(async()=>{const m=await a.get();return l(a),a.loaded=!0,a.lib=m,m})();return this.setShared({pkgName:t,loaded:!1,shared:a,from:n.options.name,lib:null,loading:d}),d}else{if(o!=null&&o.customShareInfo)return!1;const d=(async()=>{const m=await c.get();c.lib=m,c.loaded=!0,l(c);const h=getRegisteredShare(this.shareScopeMap,t,c,this.hooks.lifecycle.resolveShare);return h&&(h.lib=m,h.loaded=!0,h.from=c.from),m})();return this.setShared({pkgName:t,loaded:!1,shared:c,from:n.options.name,lib:null,loading:d}),d}}initializeSharing(t=DEFAULT_SCOPE,o){const{host:n}=this,s=o==null?void 0:o.from,i=o==null?void 0:o.strategy;let c=o==null?void 0:o.initScope;const a=[];if(s!=="build"){const{initTokens:p}=this;c||(c=[]);let y=p[t];if(y||(y=p[t]={from:this.host.name}),c.indexOf(y)>=0)return a;c.push(y)}const l=this.shareScopeMap,u=n.options.name;l[t]||(l[t]={});const d=l[t],m=(p,y)=>{var T;const{version:R,eager:g}=y;d[p]=d[p]||{};const E=d[p],_=E[R],S=!!(_&&(_.eager||(T=_.shareConfig)!=null&&T.eager));(!_||_.strategy!=="loaded-first"&&!_.loaded&&(!g!=!S?g:u>_.from))&&(E[R]=y)},h=async p=>{const{module:y}=await n.remoteHandler.getRemoteModuleAndOptions({id:p});await y.init()};return Object.keys(n.options.shared).forEach(p=>{n.options.shared[p].forEach(R=>{R.scope.includes(t)&&m(p,R)})}),(n.options.shareStrategy==="version-first"||i==="version-first")&&n.options.remotes.forEach(p=>{p.shareScope===t&&a.push(h(p.name))}),a}loadShareSync(t,o){const{host:n}=this,s=getTargetSharedOptions({pkgName:t,extraOptions:o,shareInfos:n.options.shared});s!=null&&s.scope&&s.scope.forEach(a=>{this.initializeSharing(a,{strategy:s.strategy})});const i=getRegisteredShare(this.shareScopeMap,t,s,this.hooks.lifecycle.resolveShare),c=a=>{a.useIn||(a.useIn=[]),addUniqueItem(a.useIn,n.options.name)};if(i){if(typeof i.lib=="function")return c(i),i.loaded||(i.loaded=!0,i.from===n.options.name&&(s.loaded=!0)),i.lib;if(typeof i.get=="function"){const a=i.get();if(!(a instanceof Promise))return c(i),this.setShared({pkgName:t,loaded:!0,from:n.options.name,lib:a,shared:i}),a}}if(s.lib)return s.loaded||(s.loaded=!0),s.lib;if(s.get){const a=s.get();if(a instanceof Promise){const l=(o==null?void 0:o.from)==="build"?RUNTIME_005:RUNTIME_006;throw new Error(getShortErrorMsg(l,runtimeDescMap,{hostName:n.options.name,sharedPkgName:t}))}return s.lib=a,this.setShared({pkgName:t,loaded:!0,from:n.options.name,lib:s.lib,shared:s}),s.lib}throw new Error(getShortErrorMsg(RUNTIME_006,runtimeDescMap,{hostName:n.options.name,sharedPkgName:t}))}initShareScopeMap(t,o,n={}){const{host:s}=this;this.shareScopeMap[t]=o,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:o,options:s.options,origin:s,scopeName:t,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:t,shared:o,from:n,lib:s,loading:i,loaded:c,get:a}){const{version:l,scope:u="default",...d}=o;(Array.isArray(u)?u:[u]).forEach(h=>{if(this.shareScopeMap[h]||(this.shareScopeMap[h]={}),this.shareScopeMap[h][t]||(this.shareScopeMap[h][t]={}),!this.shareScopeMap[h][t][l]){this.shareScopeMap[h][t][l]={version:l,scope:[h],...d,lib:s,loaded:c,loading:i},a&&(this.shareScopeMap[h][t][l].get=a);return}const p=this.shareScopeMap[h][t][l];i&&!p.loading&&(p.loading=i),c&&!p.loaded&&(p.loaded=c),n&&p.from!==n&&(p.from=n)})}_setGlobalShareScopeMap(t){const o=getGlobalShareScope(),n=t.id||t.name;n&&!o[n]&&(o[n]=this.shareScopeMap)}}class RemoteHandler{constructor(t){this.hooks=new PluginSystem({beforeRegisterRemote:new SyncWaterfallHook("beforeRegisterRemote"),registerRemote:new SyncWaterfallHook("registerRemote"),beforeRequest:new AsyncWaterfallHook("beforeRequest"),onLoad:new AsyncHook("onLoad"),handlePreloadModule:new SyncHook("handlePreloadModule"),errorLoadRemote:new AsyncHook("errorLoadRemote"),beforePreloadRemote:new AsyncHook("beforePreloadRemote"),generatePreloadAssets:new AsyncHook("generatePreloadAssets"),afterPreloadRemote:new AsyncHook,loadEntry:new AsyncHook}),this.host=t,this.idToRemoteMap={}}formatAndRegisterRemote(t,o){return(o.remotes||[]).reduce((s,i)=>(this.registerRemote(i,s,{force:!1}),s),t.remotes)}setIdToRemoteMap(t,o){const{remote:n,expose:s}=o,{name:i,alias:c}=n;if(this.idToRemoteMap[t]={name:n.name,expose:s},c&&t.startsWith(i)){const a=t.replace(i,c);this.idToRemoteMap[a]={name:n.name,expose:s};return}if(c&&t.startsWith(c)){const a=t.replace(c,i);this.idToRemoteMap[a]={name:n.name,expose:s}}}async loadRemote(t,o){const{host:n}=this;try{const{loadFactory:s=!0}=o||{loadFactory:!0},{module:i,moduleOptions:c,remoteMatchInfo:a}=await this.getRemoteModuleAndOptions({id:t}),{pkgNameOrAlias:l,remote:u,expose:d,id:m,remoteSnapshot:h}=a,p=await i.get(m,d,o,h),y=await this.hooks.lifecycle.onLoad.emit({id:m,pkgNameOrAlias:l,expose:d,exposeModule:s?p:void 0,exposeModuleFactory:s?void 0:p,remote:u,options:c,moduleInstance:i,origin:n});return this.setIdToRemoteMap(t,a),typeof y=="function"?y:p}catch(s){const{from:i="runtime"}=o||{from:"runtime"},c=await this.hooks.lifecycle.errorLoadRemote.emit({id:t,error:s,from:i,lifecycle:"onLoad",origin:n});if(!c)throw s;return c}}async preloadRemote(t){const{host:o}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:t,options:o.options,origin:o});const n=formatPreloadArgs(o.options.remotes,t);await Promise.all(n.map(async s=>{const{remote:i}=s,c=getRemoteInfo(i),{globalSnapshot:a,remoteSnapshot:l}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:i}),u=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:s,remote:i,remoteInfo:c,globalSnapshot:a,remoteSnapshot:l});u&&preloadAssets(c,o,u)}))}registerRemotes(t,o){const{host:n}=this;t.forEach(s=>{this.registerRemote(s,n.options.remotes,{force:o==null?void 0:o.force})})}async getRemoteModuleAndOptions(t){const{host:o}=this,{id:n}=t;let s;try{s=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:o.options,origin:o})}catch(y){if(s=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:o.options,origin:o,from:"runtime",error:y,lifecycle:"beforeRequest"}),!s)throw y}const{id:i}=s,c=matchRemoteWithNameAndExpose(o.options.remotes,i);assert(c,getShortErrorMsg(RUNTIME_004,runtimeDescMap,{hostName:o.options.name,requestId:i}));const{remote:a}=c,l=getRemoteInfo(a),u=await o.sharedHandler.hooks.lifecycle.afterResolve.emit({id:i,...c,options:o.options,origin:o,remoteInfo:l}),{remote:d,expose:m}=u;assert(d&&m,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);let h=o.moduleCache.get(d.name);const p={host:o,remoteInfo:l};return h||(h=new Module(p),o.moduleCache.set(d.name,h)),{module:h,moduleOptions:p,remoteMatchInfo:u}}registerRemote(t,o,n){const{host:s}=this,i=()=>{if(t.alias){const a=o.find(l=>{var u;return t.alias&&(l.name.startsWith(t.alias)||((u=l.alias)==null?void 0:u.startsWith(t.alias)))});assert(!a,`The alias ${t.alias} of remote ${t.name} is not allowed to be the prefix of ${a&&a.name} name or alias`)}"entry"in t&&isBrowserEnv()&&!t.entry.startsWith("http")&&(t.entry=new URL(t.entry,window.location.origin).href),t.shareScope||(t.shareScope=DEFAULT_SCOPE),t.type||(t.type=DEFAULT_REMOTE_TYPE)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:t,origin:s});const c=o.find(a=>a.name===t.name);if(!c)i(),o.push(t),this.hooks.lifecycle.registerRemote.emit({remote:t,origin:s});else{const a=[`The remote "${t.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];n!=null&&n.force&&(this.removeRemote(c),i(),o.push(t),this.hooks.lifecycle.registerRemote.emit({remote:t,origin:s}),warn$1(a.join(" ")))}}removeRemote(t){var o;try{const{host:n}=this,{name:s}=t,i=n.options.remotes.findIndex(a=>a.name===s);i!==-1&&n.options.remotes.splice(i,1);const c=n.moduleCache.get(t.name);if(c){const a=c.remoteInfo,l=a.entryGlobalName;CurrentGlobal[l]&&((o=Object.getOwnPropertyDescriptor(CurrentGlobal,l))!=null&&o.configurable?delete CurrentGlobal[l]:CurrentGlobal[l]=void 0);const u=getRemoteEntryUniqueKey(c.remoteInfo);globalLoading[u]&&delete globalLoading[u],n.snapshotHandler.manifestCache.delete(a.entry);let d=a.buildVersion?composeKeyWithSeparator(a.name,a.buildVersion):a.name;const m=CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex(p=>a.buildVersion?p.options.id===d:p.name===d);if(m!==-1){const p=CurrentGlobal.__FEDERATION__.__INSTANCES__[m];d=p.options.id||d;const y=getGlobalShareScope();let R=!0;const g=[];Object.keys(y).forEach(E=>{const _=y[E];_&&Object.keys(_).forEach(S=>{const T=_[S];T&&Object.keys(T).forEach(b=>{const I=T[b];I&&Object.keys(I).forEach(A=>{const w=I[A];w&&typeof w=="object"&&w.from===a.name&&(w.loaded||w.loading?(w.useIn=w.useIn.filter(N=>N!==a.name),w.useIn.length?R=!1:g.push([E,S,b,A])):g.push([E,S,b,A]))})})})}),R&&(p.shareScopeMap={},delete y[d]),g.forEach(([E,_,S,T])=>{var b,I,A;(A=(I=(b=y[E])==null?void 0:b[_])==null?void 0:I[S])==null||delete A[T]}),CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(m,1)}const{hostGlobalSnapshot:h}=getGlobalRemoteInfo(t,n);if(h){const p=h&&"remotesInfo"in h&&h.remotesInfo&&getInfoWithoutType(h.remotesInfo,t.name).key;p&&(delete h.remotesInfo[p],Global.__FEDERATION__.__MANIFEST_LOADING__[p]&&delete Global.__FEDERATION__.__MANIFEST_LOADING__[p])}n.moduleCache.delete(t.name)}}catch(n){logger.log("removeRemote fail: ",n)}}}const USE_SNAPSHOT=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;class ModuleFederation{constructor(t){this.hooks=new PluginSystem({beforeInit:new SyncWaterfallHook("beforeInit"),init:new SyncHook,beforeInitContainer:new AsyncWaterfallHook("beforeInitContainer"),initContainer:new AsyncWaterfallHook("initContainer")}),this.version="0.0.0-perf-devtools-20260108034446",this.moduleCache=new Map,this.loaderHook=new PluginSystem({getModuleInfo:new SyncHook,createScript:new SyncHook,createLink:new SyncHook,fetch:new AsyncHook,loadEntryError:new AsyncHook,getModuleFactory:new AsyncHook}),this.bridgeHook=new PluginSystem({beforeBridgeRender:new SyncHook,afterBridgeRender:new SyncHook,beforeBridgeDestroy:new SyncHook,afterBridgeDestroy:new SyncHook});const o=USE_SNAPSHOT?[snapshotPlugin(),generatePreloadAssetsPlugin()]:[],n={id:getBuilderId(),name:t.name,plugins:o,remotes:[],shared:{},inBrowser:isBrowserEnv()};this.name=t.name,this.options=n,this.snapshotHandler=new SnapshotHandler(this),this.sharedHandler=new SharedHandler(this),this.remoteHandler=new RemoteHandler(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...t.plugins||[]]),this.options=this.formatOptions(n,t)}initOptions(t){this.registerPlugins(t.plugins);const o=this.formatOptions(this.options,t);return this.options=o,o}async loadShare(t,o){return this.sharedHandler.loadShare(t,o)}loadShareSync(t,o){return this.sharedHandler.loadShareSync(t,o)}initializeSharing(t=DEFAULT_SCOPE,o){return this.sharedHandler.initializeSharing(t,o)}initRawContainer(t,o,n){const s=getRemoteInfo({name:t,entry:o}),i=new Module({host:this,remoteInfo:s});return i.remoteEntryExports=n,this.moduleCache.set(t,i),i}async loadRemote(t,o){return this.remoteHandler.loadRemote(t,o)}async preloadRemote(t){return this.remoteHandler.preloadRemote(t)}initShareScopeMap(t,o,n={}){this.sharedHandler.initShareScopeMap(t,o,n)}formatOptions(t,o){const{shared:n}=formatShareConfigs(t,o),{userOptions:s,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:o,options:t,shareInfo:n}),c=this.remoteHandler.formatAndRegisterRemote(i,s),{shared:a}=this.sharedHandler.registerShared(i,s),l=[...i.plugins];s.plugins&&s.plugins.forEach(d=>{l.includes(d)||l.push(d)});const u={...t,...o,plugins:l,remotes:c,shared:a};return this.hooks.lifecycle.init.emit({origin:this,options:u}),u}registerPlugins(t){const o=registerPlugins(t,this);this.options.plugins=this.options.plugins.reduce((n,s)=>(s&&n&&!n.find(i=>i.name===s.name)&&n.push(s),n),o||[])}registerRemotes(t,o){return this.remoteHandler.registerRemotes(t,o)}registerShared(t){this.sharedHandler.registerShared(this.options,{...this.options,shared:t})}}let FederationInstance=null;function getInstance(){return FederationInstance}setGlobalFederationConstructor(ModuleFederation);function addBasenameToNestedRoutes(r,t){return r.map(o=>{const n={...o,path:t+o.path};return o.children&&o.children.length>0&&(n.children=addBasenameToNestedRoutes(o.children,t)),n})}function processRoutes(r){const{router:t,basename:o,memoryRoute:n,hashRoute:s}=r,i=t.getRoutes().sort((h,p)=>h.path.split("/").filter(y=>y).length-p.path.split("/").filter(y=>y).length),c=new Map,a=new Set;i.forEach(h=>{c.set(h.path,h)});const l=(h,p)=>`${h}/${p}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",u=(h,p="")=>{if(!h.children||h.children.length===0)return h;for(let y=0;y<h.children.length;y++){const R=h.children[y],g=l(p,R.path),E=c.get(g);if(E&&!a.has(E)){const _={...E,path:R.path};h.children[y]=_,a.add(E),u(_,g)}}return h};let d=[];for(const h of i)if(!a.has(h)){const p=u(h,h.path);a.add(h),d.push(p)}let m;return n?m=VueRouter__namespace.createMemoryHistory(o):s?(m=VueRouter__namespace.createWebHashHistory(),o&&(d=addBasenameToNestedRoutes(d,o))):m=VueRouter__namespace.createWebHistory(o),{history:m,routes:d}}function createBridgeComponent(r){const t=new Map,o=getInstance();return()=>({__APP_VERSION__:"0.0.0-perf-devtools-20260108034446",async render(n){var y,R,g;LoggerInstance.debug("createBridgeComponent render Info",n);const{moduleName:s,dom:i,basename:c,memoryRoute:a,hashRoute:l,...u}=n,d=Vue__namespace.createApp(r.rootComponent,u);t.set(i,d);const m=await((g=(R=(y=o==null?void 0:o.bridgeHook)==null?void 0:y.lifecycle)==null?void 0:R.beforeBridgeRender)==null?void 0:g.emit(n)),h=m&&typeof m=="object"&&(m!=null&&m.extraProps)?m==null?void 0:m.extraProps:{},p=r.appOptions({app:d,basename:c,memoryRoute:a,hashRoute:l,...u,...h});if(p!=null&&p.router){const{history:E,routes:_}=processRoutes({router:p.router,basename:n.basename,memoryRoute:n.memoryRoute,hashRoute:n.hashRoute}),S=VueRouter__namespace.createRouter({...p.router.options,history:E,routes:_});LoggerInstance.debug("createBridgeComponent render router info>>>",{moduleName:s,router:S}),a&&await S.push(a.entryPath),d.use(S)}d.mount(i)},destroy(n){LoggerInstance.debug("createBridgeComponent destroy Info",n);const s=t.get(n==null?void 0:n.dom);s==null||s.unmount()}})}function e(){const r=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(r)}const RemoteApp=Vue.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(r){const t=Vue.ref(null),o=Vue.ref(null),n=Vue.ref(""),s=VueRouter.useRoute(),i=getInstance(),c=Vue.useAttrs(),a=async()=>{var h,p,y,R;const u=(h=r.providerInfo)==null?void 0:h.call(r);o.value=u;let d={...c,moduleName:r.moduleName,dom:t.value,basename:r.basename,memoryRoute:r.memoryRoute,hashRoute:r.hashRoute};LoggerInstance.debug("createRemoteAppComponent LazyComponent render >>>",d);const m=await((R=(y=(p=i==null?void 0:i.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:R.emit(d))||{};d={...d,...m.extraProps},u.render(d)},l=Vue.watch(()=>s==null?void 0:s.path,u=>{u!==s.path&&a(),n.value!==""&&n.value!==u&&(LoggerInstance.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...r,pathname:s.path}),e()),n.value=u});return Vue.onMounted(()=>{a()}),Vue.onBeforeUnmount(()=>{var u;LoggerInstance.debug("createRemoteAppComponent LazyComponent destroy >>>",{...r}),l(),(u=o.value)==null||u.destroy({dom:t.value})}),()=>Vue.createVNode("div",Vue.mergeProps(r.rootAttrs||{},{ref:t}),null)}});function createRemoteAppComponent(r){return Vue.defineAsyncComponent({__APP_VERSION__:"0.0.0-perf-devtools-20260108034446",...r.asyncComponentOptions,loader:async()=>{var l,u;const t=VueRouter.useRoute();let o="/";const n=(u=(l=t==null?void 0:t.matched)==null?void 0:l[0])==null?void 0:u.path;n&&(n.endsWith("/:pathMatch(.*)*")?o=n.replace("/:pathMatch(.*)*",""):o=t.matched[0].path);const s=(r==null?void 0:r.export)||"default";LoggerInstance.debug("createRemoteAppComponent LazyComponent create >>>",{basename:o,info:r});const i=await r.loader(),c=i&&i[Symbol.for("mf_module_id")],a=i[s];if(LoggerInstance.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:c,module:i,exportName:s,basename:o,route:t}),s in i&&typeof a=="function")return{render(){return Vue.h(RemoteApp,{moduleName:c,providerInfo:a,basename:o,rootAttrs:r.rootAttrs})}};throw new Error("module not found")}})}function createRemoteComponent(r){return LoggerInstance.warn("createRemoteAppComponent is deprecated, please use createRemoteAppComponent instead!"),createRemoteAppComponent(r)}exports.createBridgeComponent=createBridgeComponent;exports.createRemoteAppComponent=createRemoteAppComponent;exports.createRemoteComponent=createRemoteComponent;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("vue"),He=require("vue-router");function st(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ir=st(N),pe=st(He),ar=".json",cr="FEDERATION_DEBUG",lr=":";let Pe=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const j=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function it(){return j}function at(){return typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative"}function ur(){try{if(it()&&window.localStorage)return!!localStorage.getItem(cr)}catch{return!1}return!1}function ke(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:ur()}const fr="[ Federation Runtime ]",ct=function(...e){return e.length?e.reduce((t,r)=>r?t?`${t}${lr}${r}`:r:t,""):""};function Le(e,t){if("getPublicPath"in e){let r;return e.getPublicPath.startsWith("function")?r=new Function("return "+e.getPublicPath)()():r=new Function(e.getPublicPath)(),`${r}${t}`}else return"publicPath"in e?!it()&&!at()&&"ssrPublicPath"in e&&typeof e.ssrPublicPath=="string"?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")}const lt=e=>{console.warn(`${fr}: ${e}`)};function ut(e){try{return JSON.stringify(e,null,2)}catch{return""}}const $e=(e,t)=>{if(!e)return t;const o=(n=>{if(n===".")return"";if(n.startsWith("./"))return n.replace("./","");if(n.startsWith("/")){const s=n.slice(1);return s.endsWith("/")?s.slice(0,-1):s}return n})(e);return o?o.endsWith("/")?`${o}${t}`:`${o}/${t}`:t};function dr(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function hr(e,t={}){var _;const{remotes:r={},overrides:o={},version:n}=t;let s;const i=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&n?dr(n):e.metaData.publicPath:e.metaData.getPublicPath,a=Object.keys(o);let c={};Object.keys(r).length||(c=((_=e.remotes)==null?void 0:_.reduce((E,R)=>{let S;const b=R.federationContainerName;return a.includes(b)?S=o[b]:"version"in R?S=R.version:S=R.entry,E[b]={matchedVersion:S},E},{}))||{}),Object.keys(r).forEach(E=>c[E]={matchedVersion:a.includes(E)?o[E]:r[E]});const{remoteEntry:{path:l,name:u,type:f},types:d={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:m},globalName:h,ssrRemoteEntry:p}=e.metaData,{exposes:y}=e;let g={version:n||"",buildVersion:m,globalName:h,remoteEntry:$e(l,u),remoteEntryType:f,remoteTypes:$e(d.path,d.name),remoteTypesZip:d.zip||"",remoteTypesAPI:d.api||"",remotesInfo:c,shared:e==null?void 0:e.shared.map(E=>({assets:E.assets,sharedName:E.name,version:E.version,usedExports:E.referenceExports||[]})),modules:y==null?void 0:y.map(E=>({moduleName:E.name,modulePath:E.path,assets:E.assets}))};if("publicPath"in e.metaData?(s={...g,publicPath:i()},typeof e.metaData.ssrPublicPath=="string"&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...g,getPublicPath:i()},p){const E=$e(p.path,p.name);s.ssrRemoteEntry=E,s.ssrRemoteEntryType=p.type||"commonjs-module"}return s}function ft(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(ar))}const mr="[ Module Federation ]",te=console,pr=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function yr(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
|
|
2
|
+
`),r=t.filter(o=>!pr.some(n=>o.includes(n)));return r.length?`Stack trace:
|
|
3
|
+
${r.slice(0,5).join(`
|
|
4
|
+
`)}`:void 0}catch{return}}var dt=class{constructor(e,t=te){this.prefix=e,this.delegate=t??te}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??te}emit(e,t){const r=this.delegate,o=ke()?yr():void 0,n=o?[...t,o]: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 i of s){const a=r[i];if(typeof a=="function"){a.call(r,this.prefix,...n);return}}for(const i of s){const a=te[i];if(typeof a=="function"){a.call(te,this.prefix,...n);return}}}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){ke()&&this.emit("debug",e)}};function ht(e){return new dt(e)}function Er(e){const t=new dt(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Er(mr);async function mt(e,t){try{return await e()}catch(r){lt(r);return}}function Oe(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function pt(e){let t=null,r=!0,o=2e4,n;const s=document.getElementsByTagName("script");for(let l=0;l<s.length;l++){const u=s[l],f=u.getAttribute("src");if(f&&Oe(f,e.url)){t=u,r=!1;break}}if(!t){const l=e.attrs;t=document.createElement("script"),t.type=(l==null?void 0:l.type)==="module"?"module":"text/javascript";let u;e.createScriptHook&&(u=e.createScriptHook(e.url,e.attrs),u instanceof HTMLScriptElement?t=u:typeof u=="object"&&("script"in u&&u.script&&(t=u.script),"timeout"in u&&u.timeout&&(o=u.timeout))),t.src||(t.src=e.url),l&&!u&&Object.keys(l).forEach(f=>{t&&(f==="async"||f==="defer"?t[f]=l[f]:t.getAttribute(f)||t.setAttribute(f,l[f]))})}let i=null;const a=typeof window<"u"?l=>{if(l.filename&&Oe(l.filename,e.url)){const u=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);u.name="ScriptExecutionError",i=u}}:null;a&&window.addEventListener("error",a);const c=async(l,u)=>{clearTimeout(n),a&&window.removeEventListener("error",a);const f=()=>{if((u==null?void 0:u.type)==="error"){const d=new Error(u!=null&&u.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);d.name="ScriptNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(d))}else i?e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(i)):e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,mt(()=>{const{needDeleteScript:d=!0}=e;d&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),l&&typeof l=="function")){const d=l(u);if(d instanceof Promise){const m=await d;return f(),m}return f(),d}f()};return t.onerror=c.bind(null,t.onerror),t.onload=c.bind(null,t.onload),n=setTimeout(()=>{c(null,{type:"error",isTimeout:!0})},o),{script:t,needAttach:r}}function gr(e){let t=null,r=!0,o=2e4,n;const s=document.getElementsByTagName("link");for(let a=0;a<s.length;a++){const c=s[a],l=c.getAttribute("href"),u=c.getAttribute("rel");if(l&&Oe(l,e.url)&&u===e.attrs.rel){t=c,r=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let a,c=!0;const l=e.attrs;e.createLinkHook&&(a=e.createLinkHook(e.url,l),a instanceof HTMLLinkElement?(t=a,c=!1):typeof a=="object"&&("link"in a&&a.link&&(t=a.link,c=!1),"timeout"in a&&a.timeout&&(o=a.timeout))),l&&c&&Object.keys(l).forEach(u=>{t&&!t.getAttribute(u)&&t.setAttribute(u,l[u])})}if(!r)return Promise.resolve().then(()=>{e!=null&&e.cb&&(e==null||e.cb())}),{link:t,needAttach:r};const i=(a,c)=>{n&&clearTimeout(n);const l=()=>{if((c==null?void 0:c.type)==="error"){const u=new Error(c!=null&&c.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);u.name="LinkNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(u))}else e!=null&&e.cb&&(e==null||e.cb())};if(t&&(t.onerror=null,t.onload=null,mt(()=>{const{needDeleteLink:u=!0}=e;u&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),a)){const u=a(c);return l(),u}l()};return t.onerror=i.bind(null,t.onerror),t.onload=i.bind(null,t.onload),n=setTimeout(()=>{i(null,{type:"error",isTimeout:!0})},o),{link:t,needAttach:r}}function _r(e,t){const{attrs:r={},createScriptHook:o}=t;return new Promise((n,s)=>{const{script:i,needAttach:a}=pt({url:e,cb:n,onErrorCallback:s,attrs:{fetchpriority:"high",...r},createScriptHook:o,needDeleteScript:!0});a&&document.head.appendChild(i)})}const ue=new Map;function U(e){if(!e)throw new Error("import specifier is required");if(ue.has(e))return ue.get(e);const t=new Function("name","return import(name)")(e).then(r=>r).catch(r=>{throw console.error(`Error importing module ${e}:`,r),ue.delete(e),r});return ue.set(e,t),t}const Rr=async(e,t,r)=>{const n=await((s,i)=>r.lifecycle.fetch.emit(s,i))(e,t||{});return!n||!(n instanceof Response)?fetch(e,t||{}):n},Sr=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,r,o)=>{if(o!=null&&o.createScriptHook){const a=o.createScriptHook(e);a&&typeof a=="object"&&"url"in a&&(e=a.url)}let n;try{n=new URL(e)}catch(a){console.error("Error constructing URL:",a),t(new Error(`Invalid URL: ${a}`));return}const s=async()=>o!=null&&o.fetch?(a,c)=>Rr(a,c,o):fetch,i=async(a,c)=>{var l;try{const f=await(await a(c.href)).text(),[d,m]=await Promise.all([U("path"),U("vm")]),h={exports:{},module:{exports:{}}},p=c.pathname.split("/").slice(0,-1).join("/"),y=d.basename(c.pathname),g=new m.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
5
|
+
})`,{filename:y,importModuleDynamically:((l=m.constants)==null?void 0:l.USE_MAIN_CONTEXT_DEFAULT_LOADER)??U});let _;_=(await U("node:module")).createRequire(c.protocol==="file:"||c.protocol==="node:"?c.href:d.join(process.cwd(),"__mf_require_base__.js")),g.runInThisContext()(h.exports,h.module,_,p,y);const E=h.module.exports||h.exports;if(r&&E&&r.globalName){t(void 0,E[r.globalName]||E);return}t(void 0,E)}catch(u){t(u instanceof Error?u:new Error(`Script execution error: ${u}`))}};s().then(async a=>{if((r==null?void 0:r.type)==="esm"||(r==null?void 0:r.type)==="module")return gt(n.href,{fetch:a,vm:await U("vm")}).then(async c=>{await c.evaluate(),t(void 0,c.namespace)}).catch(c=>{t(c instanceof Error?c:new Error(`Script execution error: ${c}`))});i(a,n)}).catch(a=>{t(a)})}:(e,t,r,o)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},br=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((r,o)=>{Sr(e,(n,s)=>{var i,a;if(n)o(n);else{const c=((i=t==null?void 0:t.attrs)==null?void 0:i.globalName)||`__FEDERATION_${(a=t==null?void 0:t.attrs)==null?void 0:a.name}:custom__`;r(globalThis[c]=s)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},X=new Map,yt=e=>e.startsWith("http:")||e.startsWith("https:"),Et=e=>!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("/")&&!e.includes(":");function wr(e){const t=new URL(e),r=encodeURIComponent(t.protocol.slice(0,-1)),o=encodeURIComponent(t.host),n=t.pathname.split("/").map(i=>encodeURIComponent(i)).join("/"),s=encodeURIComponent(`${t.search}${t.hash}`);return`/${r}/${o}${n}${s?`/${s}`:""}`}function Ir(e,t){const r=t.endsWith("/")?t:`${t}/`;return new URL(`__module_federation_remote__${wr(e)}`,r).href}async function $r(e){return e.startsWith("node:")?!0:Et(e)?(await U("node:module")).builtinModules.includes(e):!1}function vr(e){const t=e&&(typeof e=="object"||typeof e=="function")?e:{default:e},r={...t};return Object.prototype.hasOwnProperty.call(r,"default")||(r.default=t),r}async function Tr(e,t,r){if(typeof r.SyntheticModule!="function")throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");const o=vr(t),n=Object.keys(o),s=new r.SyntheticModule(n,function(){for(const a of n)this.setExport(a,o[a])},{identifier:e});return X.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}async function Nr(e,t){const r=`node-builtin:${e}`;return X.has(r)?X.get(r):Tr(r,await U(e),t)}async function qe(e,t,r){if(await $r(e))return Nr(e,r.vm);if(Et(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 o=new URL(e,t).href;if(!yt(o))throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${o}". Only http(s) remote modules and Node.js built-in modules are supported.`);return gt(o,r)}async function Ar(e){if(e.status==="linked"&&await e.evaluate(),e.status==="errored")throw e.error;return e}async function gt(e,t){if(X.has(e))return X.get(e);const{fetch:r,vm:o}=t;if(!yt(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 r(e)).text(),s=(await U("node:url")).pathToFileURL(process.cwd()).href,i=new o.SourceTextModule(n,{identifier:e,initializeImportMeta:a=>{a.url=Ir(e,s)},importModuleDynamically:async a=>Ar(await qe(a,e,t))});return X.set(e,i),await i.link(async a=>qe(a,e,t)),i}const D=ht("[ Module Federation Bridge Vue3 ]"),Mr=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,_t=(e,t,r,o)=>{const n=[`${[t[e]]} #${e}`];return r&&n.push(`args: ${JSON.stringify(r)}`),n.push(Mr(e)),o&&n.push(`Original Error Message:
|
|
6
|
+
${o}`),n.join(`
|
|
7
|
+
`)};function Pr(e,t,r,o,n,s){return o(_t(e,t,r,n))}const W="[ Federation Runtime ]",Ce=ht(W);function L(e,t,r,o,n){e||I(t)}function I(e,t,r,o,n){if(t!==void 0)return Pr(e,t,r??{},i=>{throw new Error(`${W}: ${i}`)},o);const s=e;throw s instanceof Error?(s.message.startsWith(W)||(s.message=`${W}: ${s.message}`),s):new Error(`${W}: ${s}`)}function se(e){e instanceof Error&&(e.message.startsWith(W)||(e.message=`${W}: ${e.message}`)),Ce.warn(e)}function kr(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function ie(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Fe(e){return typeof e.entry<"u"}function Rt(e){return!e.entry.includes(".json")}function xe(e){return e&&typeof e=="object"}const Lr=Object.prototype.toString;function St(e){return Lr.call(e)==="[object Object]"}function bt(e){return Array.isArray(e)?e:[e]}function wt(e){const t={url:"",type:"global",globalName:""};return j||at()||!("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 Or=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},Cr=2e3,T=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return T}})(),we=O;function ye(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function Ee(e,t){return Object.hasOwnProperty.call(e,t)}Ee(T,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ye(T,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const G=T.__GLOBAL_LOADING_REMOTE_ENTRY__;function It(e){var t,r,o,n,s,i,a;Ee(e,"__VMOK__")&&!Ee(e,"__FEDERATION__")&&ye(e,"__FEDERATION__",e.__VMOK__),Ee(e,"__FEDERATION__")||(ye(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map,__PRELOADED_ASSETS__:new Set}),ye(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(o=e.__FEDERATION__).moduleInfo??(o.moduleInfo={}),(n=e.__FEDERATION__).__SHARE__??(n.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map),(a=e.__FEDERATION__).__PRELOADED_ASSETS__??(a.__PRELOADED_ASSETS__=new Set)}It(T);It(O);function Dr(e,t=ke()){t&&(T.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.0.0-perf-website-code-usage-20260914033703")}function q(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const o of r){const[n,s]=o.split(":"),i=`${n}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else I(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const ze=()=>O.__FEDERATION__.moduleInfo,Hr=(e,t)=>{const r=q(t,ie(e)).value;if(r&&!r.version&&"version"in e&&e.version&&(r.version=e.version),r)return r;if("version"in e&&e.version){const{version:o,...n}=e,s=ie(n),i=q(O.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===o)return i}},ge=e=>Hr(e,O.__FEDERATION__.moduleInfo),Ke=(e,t)=>{const r=ie(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},Fr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),Ge=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:T[r]}},xr=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,Gr=e=>T.__FEDERATION__.__PRELOADED_MAP__.get(e),Ur=e=>T.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Br=e=>T.__FEDERATION__.__PRELOADED_ASSETS__.has(e),jr=e=>{const t=T.__FEDERATION__.__PRELOADED_ASSETS__;if(t.add(e),t.size>Cr){const r=t.values().next().value;r!==void 0&&t.delete(r)}},Je="[0-9A-Za-z-]+",Ue=`(?:\\+(${Je}(?:\\.${Je})*))`,ne="0|[1-9]\\d*",_e="[0-9]+",$t="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Ze=`(?:${_e}|${$t})`,Wr=`(?:-?(${Ze}(?:\\.${Ze})*))`,Xe=`(?:${ne}|${$t})`,vt=`(?:-(${Xe}(?:\\.${Xe})*))`,ve=`${ne}|x|X|\\*`,Q=`[v=\\s]*(${ve})(?:\\.(${ve})(?:\\.(${ve})(?:${vt})?${Ue}?)?)?`,Vr=`^\\s*(${Q})\\s+-\\s+(${Q})\\s*$`,qr=`[v=\\s]*${`(${_e})\\.(${_e})\\.(${_e})`}${Wr}?${Ue}?`,Be="((?:<|>)?=?)",zr=`(\\s*)${Be}\\s*(${qr}|${Q})`,Tt="(?:~>?)",Kr=`(\\s*)${Tt}\\s+`,Nt="(?:\\^)",Jr=`(\\s*)${Nt}\\s+`,Zr="(<|>)?=?\\s*\\*",Xr=`^${Nt}${Q}$`,Yr=`v?${`(${ne})\\.(${ne})\\.(${ne})`}${vt}?${Ue}?`,Qr=`^${Tt}${Q}$`,eo=`^${Be}\\s*${Q}$`,to=`^${Be}\\s*(${Yr})$|^$`,ro="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function M(e){return!e||e.toLowerCase()==="x"||e==="*"}function At(...e){return t=>e.reduce((r,o)=>o(r),t)}function Ye(e){return e.match(C(to))}function Qe(e,t,r,o){const n=`${e}.${t}.${r}`;return o?`${n}-${o}`:n}function oo(e){return e.replace(C(Vr),(t,r,o,n,s,i,a,c,l,u,f,d)=>(M(o)?r="":M(n)?r=`>=${o}.0.0`:M(s)?r=`>=${o}.${n}.0`:r=`>=${r}`,M(l)?c="":M(u)?c=`<${Number(l)+1}.0.0-0`:M(f)?c=`<${l}.${Number(u)+1}.0-0`:d?c=`<=${l}.${u}.${f}-${d}`:c=`<=${c}`,`${r} ${c}`.trim()))}function no(e){return e.replace(C(zr),"$1$2$3")}function so(e){return e.replace(C(Kr),"$1~")}function io(e){return e.replace(C(Jr),"$1^")}function ao(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Xr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?o==="0"?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.0 <${Number(o)+1}.0.0-0`:i?o==="0"?n==="0"?`>=${o}.${n}.${s}-${i} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s}-${i} <${Number(o)+1}.0.0-0`:o==="0"?n==="0"?`>=${o}.${n}.${s} <${o}.${n}.${Number(s)+1}-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${Number(o)+1}.0.0-0`)).join(" ")}function co(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Qr),(r,o,n,s,i)=>M(o)?"":M(n)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:M(s)?`>=${o}.${n}.0 <${o}.${Number(n)+1}.0-0`:i?`>=${o}.${n}.${s}-${i} <${o}.${Number(n)+1}.0-0`:`>=${o}.${n}.${s} <${o}.${Number(n)+1}.0-0`)).join(" ")}function lo(e){return e.split(/\s+/).map(t=>t.trim().replace(C(eo),(r,o,n,s,i,a)=>{const c=M(n),l=c||M(s),u=l||M(i);return o==="="&&u&&(o=""),a="",c?o===">"||o==="<"?"<0.0.0-0":"*":o&&u?(l&&(s=0),i=0,o===">"?(o=">=",l?(n=Number(n)+1,s=0,i=0):(s=Number(s)+1,i=0)):o==="<="&&(o="<",l?n=Number(n)+1:s=Number(s)+1),o==="<"&&(a="-0"),`${o+n}.${s}.${i}${a}`):l?`>=${n}.0.0${a} <${Number(n)+1}.0.0-0`:u?`>=${n}.${s}.0${a} <${n}.${Number(s)+1}.0-0`:r})).join(" ")}function uo(e){return e.trim().replace(C(Zr),"")}function fo(e){return e.trim().replace(C(ro),"")}function Re(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function ho(e,t){const{preRelease:r}=e,{preRelease:o}=t;if(r===void 0&&o)return 1;if(r&&o===void 0)return-1;if(r===void 0&&o===void 0)return 0;for(let n=0,s=r.length;n<=s;n++){const i=r[n],a=o[n];if(i!==a)return i===void 0&&a===void 0?0:i?a?Re(i,a):-1:1}return 0}function fe(e,t){return Re(e.major,t.major)||Re(e.minor,t.minor)||Re(e.patch,t.patch)||ho(e,t)}function Te(e,t){return e.version===t.version}function mo(e,t){switch(e.operator){case"":case"=":return Te(e,t);case">":return fe(e,t)<0;case">=":return Te(e,t)||fe(e,t)<0;case"<":return fe(e,t)>0;case"<=":return Te(e,t)||fe(e,t)>0;case void 0:return!0;default:return!1}}function po(e){return At(ao,co,lo,uo)(e)}function yo(e){return At(oo,no,so,io)(e.trim()).split(/\s+/).join(" ")}function oe(e,t){if(!e)return!1;const r=Ye(e);if(!r)return!1;const[,o,,n,s,i,a]=r,c={operator:o,version:Qe(n,s,i,a),major:n,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},l=t.split("||");for(const u of l){const f=u.trim();if(!f||f==="*"||f==="x")return!0;try{const d=yo(f);if(!d.trim())return!0;const m=d.split(" ").map(y=>po(y)).join(" ");if(!m.trim())return!0;const h=m.split(/\s+/).map(y=>fo(y)).filter(Boolean);if(h.length===0)continue;let p=!0;for(const y of h){const g=Ye(y);if(!g){p=!1;break}const[,_,,E,R,S,b]=g;if(!mo({operator:_,version:Qe(E,R,S,b),major:E,minor:R,patch:S,preRelease:b==null?void 0:b.split(".")},c)){p=!1;break}}if(p)return!0}catch(d){console.error(`[semver] Error processing range part "${f}":`,d);continue}}return!1}const le="default",Mt="global";function Eo(e,t,r,o){var s,i;let n;return"get"in e?n=e.get:"lib"in e?n=()=>Promise.resolve(e.lib):n=()=>Promise.resolve(()=>{I(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),(s=e.shareConfig)!=null&&s.eager&&((i=e.treeShaking)!=null&&i.mode)&&I(`Invalid shared config for "${r}" 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!=null&&e.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??o)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??Pe.UNKNOWN,useIn:[]}:void 0}}function Pt(e,t){const r=t.shared||{},o=t.name,n=Object.keys(r).reduce((i,a)=>{const c=bt(r[a]);return i[a]=i[a]||[],c.forEach(l=>{i[a].push(Eo(l,o,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(n).forEach(i=>{s[i]?n[i].forEach(a=>{s[i].find(c=>c.version===a.version)||s[i].push(a)}):s[i]=n[i]}),{allShareInfos:s,newShareInfos:n}}function ae(e,t){if(!e)return!1;const{status:r,mode:o}=e;return r===Pe.NO_USE?!1:r===Pe.CALCULATED?!0:o==="runtime-infer"?t?_o(e,t):!0:!1}function V(e,t){const r=o=>{if(!Number.isNaN(Number(o))){const n=o.split(".");let s=o;for(let i=0;i<3-n.length;i++)s+=".0";return s}return o};return!!oe(r(e),`<=${r(t)}`)}const ce=(e,t)=>{const r=t||function(o,n){return V(o,n)};return Object.keys(e).reduce((o,n)=>!o||r(o,n)||o==="0"?n:o,0)},be=e=>!!e.loaded||typeof e.lib=="function",go=e=>!!e.loading,_o=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(o=>r.includes(o)):!1};function Ro(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){return i?n[c].treeShaking?n[l].treeShaking?!be(n[c].treeShaking)&&V(c,l):!1:!0:!be(n[c])&&V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}const K=e=>be(e)||go(e);function So(e,t,r,o){const n=e[t][r];let s="",i=ae(o);const a=function(c,l){if(i){if(!n[c].treeShaking)return!0;if(!n[l].treeShaking)return!1;if(K(n[l].treeShaking))return K(n[c].treeShaking)?!!V(c,l):!0;if(K(n[c].treeShaking))return!1}return K(n[l])?K(n[c])?!!V(c,l):!0:K(n[c])?!1:V(c,l)};if(i){if(s=ce(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:ce(e[t][r],a),useTreesShaking:i}}function bo(e){return e==="loaded-first"?So:Ro}function Se(e,t,r,o,n){if(!e)return;const{shareConfig:s,scope:i=le,strategy:a,treeShaking:c}=r,l=Array.isArray(i)?i:[i];for(const u of l)if(s&&e[u]&&e[u][t]){const{requiredVersion:f}=s,{version:d,useTreesShaking:m}=bo(a)(e,u,t,c),h=()=>{const y=e[u][t][d];if(s.singleton){if(typeof f=="string"&&!oe(d,f)){const g=`Version ${d} from ${d&&y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;s.strictVersion?I(g):se(g)}return{shared:y,useTreesShaking:m}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:m};if(oe(d,f))return{shared:y,useTreesShaking:m};const g=ae(c);if(g){for(const[_,E]of Object.entries(e[u][t]))if(ae(E.treeShaking,c==null?void 0:c.usedExports)&&oe(_,f))return{shared:E,useTreesShaking:g}}for(const[_,E]of Object.entries(e[u][t]))if(oe(_,f))return{shared:E,useTreesShaking:!1}}},p={shareScopeMap:e,scope:u,pkgName:t,version:d,GlobalFederation:we.__FEDERATION__,shareInfo:r,resolver:h,loadContext:n};return(o.emit(p)||p).resolver()}}function kt(){return we.__FEDERATION__.__SHARE__}function et(e){const{pkgName:t,extraOptions:r,shareInfos:o}=e,n=c=>{if(!c)return;const l={};return c.forEach(f=>{l[f.version]=f}),l[ce(l,function(f,d){return!be(l[f])&&V(f,d)})]},s=(r==null?void 0:r.resolver)??n,i=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),a=(...c)=>{const l={};for(const u of c)if(u)for(const[f,d]of Object.entries(u)){const m=l[f];i(m)&&i(d)?l[f]=a(m,d):d!==void 0&&(l[f]=d)}return l};return a(s(o[t]),r==null?void 0:r.customShareInfo)}const J=(e,t)=>{e.useIn||(e.useIn=[]),kr(e.useIn,t)};function de(e,t){return t&&e.treeShaking?e.treeShaking:e}function je(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function tt(e,t){for(const r of e){const o=t.startsWith(r.name);let n=t.replace(r.name,"");if(o){if(n.startsWith("/")){const a=r.name;return n=`.${n}`,{pkgNameOrAlias:a,expose:n,remote:r}}else if(n==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const s=r.alias&&t.startsWith(r.alias);let i=r.alias&&t.replace(r.alias,"");if(r.alias&&s){if(i&&i.startsWith("/")){const a=r.alias;return i=`.${i}`,{pkgNameOrAlias:a,expose:i,remote:r}}else if(i==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function wo(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const Lt="RUNTIME-001",Ot="RUNTIME-002",Ct="RUNTIME-003",Dt="RUNTIME-004",Ht="RUNTIME-005",De="RUNTIME-006",Ft="RUNTIME-007",Ie="RUNTIME-008",Io="RUNTIME-009",xt="RUNTIME-010",Gt="RUNTIME-011",$o="RUNTIME-012",Ut="RUNTIME-013",Bt="RUNTIME-014",jt="RUNTIME-015",P={[Lt]:"Failed to get remoteEntry exports.",[Ot]:'The remote entry interface does not contain "init"',[Ct]:"Failed to get manifest.",[Dt]:"Failed to locate remote.",[Ht]:"Invalid loadShareSync function call from bundler runtime",[De]:"Invalid loadShareSync function call from runtime",[Ft]:"Failed to get remote snapshot.",[Ie]:"Failed to load script resources.",[Io]:"Please call createInstance first.",[xt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Gt]:"The remoteEntry URL is missing from the remote snapshot.",[$o]:'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.',[Ut]:"The manifest is not a valid Module Federation manifest.",[Bt]:"The remote does not expose the requested module.",[jt]:"Remote container initialization failed."};({...P});const Wt=".then(callbacks[0]).catch(callbacks[1])",rt=new WeakMap,vo=["Failed to fetch dynamically imported module","Importing a module script failed","error loading dynamically imported module"];function To(e){return e instanceof TypeError?vo.some(t=>e.message.includes(t)):!1}function Vt(e){return e==="esm"||e==="module"}async function No({entry:e,remoteEntryExports:t,name:r,getEntryUrl:o}){return new Promise((n,s)=>{const i=c=>{if(To(c)){const l=c instanceof Error?c.message:String(c);try{I(Ie,P,{remoteName:r,resourceUrl:a},l)}catch(u){s(u);return}}s(c)},a=o?o(e):e;try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${a}")${Wt}`)([n,i]):import(a).then(n).catch(i)}catch(c){I(`Failed to load ESM entry from "${a}". ${c instanceof Error?c.message:String(c)}`)}})}async function Ao({entry:e,remoteEntryExports:t}){return new Promise((r,o)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(o):new Function("callbacks",`System.import("${e}")${Wt}`)([r,o])}catch(n){I(`Failed to load SystemJS entry from "${e}". ${n instanceof Error?n.message:String(n)}`)}})}function qt(e,t,r){const{remoteEntryKey:o,entryExports:n}=Ge(e,t);return n||I(Lt,P,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:o}),n}async function Mo({name:e,globalName:t,entry:r,remoteInfo:o,loaderHook:n,getEntryUrl:s,resourceContext:i}){const{entryExports:a}=Ge(e,t);if(a)return a;const c=s?s(r):r;return _r(c,{attrs:{},createScriptHook:(l,u)=>{const f=n.lifecycle.createScript.emit({url:l,attrs:u,remoteInfo:o,resourceContext:i?{...i,url:l}:void 0});if(f&&(f instanceof HTMLScriptElement||"script"in f||"timeout"in f))return f}}).then(()=>qt(e,t,r),l=>{const u=l instanceof Error?l.message:String(l);I(Ie,P,{remoteName:e,resourceUrl:c},u)})}async function Po({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:o,resourceContext:n}){const{entry:s,entryGlobalName:i,name:a,type:c}=e;return Vt(c)?No({entry:s,remoteEntryExports:t,name:a,getEntryUrl:o}):c==="system"?Ao({entry:s,remoteEntryExports:t}):Mo({entry:s,globalName:i,name:a,remoteInfo:e,loaderHook:r,getEntryUrl:o,resourceContext:n})}async function ko({remoteInfo:e,loaderHook:t,resourceContext:r}){const{entry:o,entryGlobalName:n,name:s,type:i}=e,{entryExports:a}=Ge(s,n);return a||br(o,{attrs:{name:s,globalName:n,type:i},loaderHook:{createScriptHook:(c,l={})=>{const u=t.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:e,resourceContext:r?{...r,url:c}:void 0});if(u&&"url"in u)return u}}}).then(()=>qt(s,n,o)).catch(c=>{I(`Failed to load Node.js entry for remote "${s}" from "${o}". ${c instanceof Error?c.message:String(c)}`)})}function zt(e){const{entry:t,name:r}=e;return ct(r,t)}async function We(e){const{origin:t,remoteEntryExports:r,remoteInfo:o,getEntryUrl:n,resourceContext:s,_inErrorHandling:i=!1}=e,a=zt(o);if(r)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:r,resourceContext:s,cached:!0}),r;if(!G[a]){const l=t.remoteHandler.hooks.lifecycle.loadEntry,u=t.loaderHook,f=l.emit({origin:t,loaderHook:u,remoteInfo:o,remoteEntryExports:r,resourceContext:s}).then(d=>d||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":j)?Po({remoteInfo:o,remoteEntryExports:r,loaderHook:u,getEntryUrl:n,resourceContext:s}):ko({remoteInfo:o,loaderHook:u,resourceContext:s}))).then(async d=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:d,resourceContext:s}),d)).catch(async d=>{const m=d instanceof Error&&d.message.includes("ScriptExecutionError");if(d instanceof Error&&d.message.includes(Ie)&&!m&&!i){const h=y=>We({...y,_inErrorHandling:!0}),p=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:h,origin:t,remoteInfo:o,remoteEntryExports:r,globalLoading:G,uniqueKey:a});if(p)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:p,resourceContext:s,error:d,recovered:!0}),p}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:d}),d});G[a]=f,f.then(void 0,()=>{G[a]===f&&delete G[a]}),rt.set(f,t)}const c=G[a];if(rt.get(c)!==t)try{const l=await c;return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,remoteEntryExports:l,resourceContext:s}),l}catch(l){throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:o,resourceContext:s,error:l}),l}return c}function Z(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||Mt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||le}}function Lo(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Oo(e){const t=new Map;return[...e||[],...xr()].forEach(r=>{r&&(L(St(r),"Plugin configuration is invalid."),L(r.name,"A name must be provided by the plugin."),t.has(r.name)||t.set(r.name,r))}),Array.from(t.values())}function Co(e,t){return t===void 0?e:{...t,name:e.name,version:e.version}}function Do(e,t){const r=new Map;t.options.plugins.forEach(n=>{n&&r.set(n.name,n)});const o=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return Oo(e).forEach(n=>{var i;if(r.set(n.name,n),t.hooks.registerPlugins[n.name])return;const s=Co(n,(i=n.apply)==null?void 0:i.call(n,t));o.forEach(a=>{a.applyPlugin(s)})}),Array.from(r.values())}function Ho(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 H(e){var r,o,n,s,i,a;const t={};for(const[c,l]of Object.entries(e.shared)){const u=l[0];u&&(t[c]={version:u.version,singleton:(r=u.shareConfig)==null?void 0:r.singleton,requiredVersion:((o=u.shareConfig)==null?void 0:o.requiredVersion)===!1?!1:(n=u.shareConfig)==null?void 0:n.requiredVersion,eager:u.eager,strictVersion:(s=u.shareConfig)==null?void 0:s.strictVersion})}return{project:{name:e.name,mfRole:((i=e.remotes)==null?void 0:i.length)>0?"host":"unknown"},mfConfig:{name:e.name,remotes:((a=e.remotes)==null?void 0:a.map(Ho))??[],shared:t}}}function Kt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,recordPreloadedAssets:!0,...e}}function Fo(e,t){return t.map(r=>{const o=wo(e,r.nameOrAlias);return L(o,`Unable to preload ${r.nameOrAlias} as it is not included in ${!o&&ut({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:Kt(r)}})}function xo(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Ve(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function B(e,t,r,o){return{url:t,status:r,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:o}}function Ne(e,t,r,o){return r?Br(t)?Promise.resolve(B(e,t,"cached")):(jr(t),o()):o()}async function Go(e,t,r,o){const n=e.moduleCache.get(r.name),s=r.entry;if(n!=null&&n.remoteEntryExports)return B(o,s,"cached");try{if(!await We({origin:e,remoteInfo:r,remoteEntryExports:n==null?void 0:n.remoteEntryExports,resourceContext:{...o,url:s}}))throw new Error(`Failed to load remoteEntry "${s}".`);return B(o,s,"success")}catch(i){return B(o,s,Ve(i)?"timeout":"error",i)}}function he({host:e,remoteInfo:t,url:r,attrs:o,context:n,needDeleteLink:s}){return new Promise(i=>{const{link:a,needAttach:c}=gr({url:r,cb:()=>{i(B(n,r,c?"success":"cached"))},onErrorCallback:l=>{i(B(n,r,Ve(l)?"timeout":"error",l))},attrs:o,createLinkHook:(l,u)=>{const f=e.loaderHook.lifecycle.createLink.emit({url:l,attrs:u,remoteInfo:t,resourceContext:{...n,url:l}});return f instanceof HTMLLinkElement,f},needDeleteLink:s});c&&document.head.appendChild(a)})}function Uo({host:e,remoteInfo:t,url:r,attrs:o,context:n}){return new Promise(s=>{const{script:i,needAttach:a}=pt({url:r,cb:()=>{s(B(n,r,a?"success":"cached"))},onErrorCallback:c=>{s(B(n,r,Ve(c)?"timeout":"error",c))},attrs:o,createScriptHook:(c,l)=>{const u=e.loaderHook.lifecycle.createScript.emit({url:c,attrs:l,remoteInfo:t,resourceContext:{...n,url:c}});return u instanceof HTMLScriptElement,u},needDeleteScript:!0});a&&document.head.appendChild(i)})}function me(e,t){return{...e,resourceType:t}}function Jt(e,t,r,o=!0,n={initiator:"preloadRemote",id:e.name},s=!0){const{cssAssets:i,jsAssetsWithoutEntry:a,entryAssets:c}=r,l=[];if(t.options.inBrowser){if(c.forEach(d=>{const{moduleInfo:m}=d;l.push(Go(t,e,m,me(n,"remoteEntry")))}),o){const d={rel:"preload",as:"style"};i.forEach(m=>{const h=me(n,"css");l.push(Ne(h,m,s,()=>he({host:t,remoteInfo:e,url:m,attrs:d,context:h})))})}else{const d={rel:"stylesheet",type:"text/css"};i.forEach(m=>{const h=me(n,"css");l.push(Ne(h,m,s,()=>he({host:t,remoteInfo:e,url:m,attrs:d,needDeleteLink:!1,context:h})))})}let u=Uo,f={fetchpriority:"high",type:"text/javascript"};o?(u=he,f={rel:"preload",as:"script"}):Vt(e.type)&&(u=he,f={rel:"modulepreload",fetchpriority:"high"}),a.forEach(d=>{const m=me(n,"js");l.push(Ne(m,d,s,()=>u({host:t,remoteInfo:e,url:d,attrs:f,context:m})))})}return Promise.all(l)}function Bo(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map(r=>r.moduleName).filter(Boolean);return t.length?t.join(","):void 0}function jo(e,t,r){const o=t,n=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];n.length||n.push("default"),n.forEach(i=>{o[i]||(o[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?n:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:o,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:o[n[0]],initScope:r??[]}}var ot=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,t){const r=t||{initiator:"loadRemote",id:je(this.remoteInfo.name,e),resourceType:"remoteEntry",url:this.remoteInfo.entry,expose:e},o=await We({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:r});return L(o,`remoteEntryExports is undefined
|
|
8
|
+
${ut(this.remoteInfo)}`),this.remoteEntryExports=o,this.remoteEntryExports}async init(e,t,r,o,n){const s=await this.getEntry(o,n);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host}),s;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,cached:!0,origin:this.host}),i}return s}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:i,shareScope:a,initScope:c}=jo(this.remoteInfo,this.host.shareScopeMap,r),l=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a,remoteEntryInitOptions:i,initScope:c,remoteInfo:this.remoteInfo,origin:this.host});typeof(s==null?void 0:s.init)>"u"&&I(Ot,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,H(this.host.options));try{await s.init(l.shareScope,l.initScope,l.remoteEntryInitOptions)}catch(u){I(jt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${u}`,H(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...l,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(i){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:i,origin:this.host}),i}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,r,o){const{loadFactory:n=!0}=r||{loadFactory:!0},s=await this.init(e,o,void 0,t);this.lib=s,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,origin:this.host});let i;try{const l=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo});i=typeof l=="function"?l:void 0,i||(i=await s.get(t)),i||I(Bt,P,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Bo(o)},void 0,H(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(l){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:s,error:l,origin:this.host}),l}const a=Or(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 l=await c();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,exposeModule:l,origin:this.host}),l}catch(l){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:n,error:l,origin:this.host}),l}}wraperFactory(e,t){function r(o,n){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:n,enumerable:!1})}return()=>{const o=e();return o instanceof Promise?o.then(n=>(r(n,t),n)):(r(o,t),o)}}},F=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e){L(St(e),"Plugin configuration is invalid.");const t=e.name;L(t,"A name must be provided by the plugin."),this.registerPlugins[t]||(this.registerPlugins[t]=e,this.lifecycleKeys.forEach(r=>{const o=e[r];o&&this.lifecycle[r].on(o)}))}removePlugin(e){L(e,"A name is required.");const t=this.registerPlugins[e];L(t,`The plugin "${e}" is not registered.`),this.lifecycleKeys.forEach(r=>{const o=t[r];o&&this.lifecycle[r].remove(o)}),delete this.registerPlugins[e]}},A=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function r(...o){return t.remove(r),e.apply(null,o)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{const o=r(...e);o!==void 0&&(t=o)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},v=class extends A{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let o=0;const n=s=>s===!1?!1:o<r.length?Promise.resolve(r[o++].apply(null,e)).then(i=>i===void 0||e.length===1&&i===e[0]?n(s):n(i)):s;t=n()}return Promise.resolve(t)}};function Zt(e,t){if(!xe(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var Y=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(r===void 0)continue;if(Zt(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){se(r),this.onerror(r)}return e}},x=class extends A{constructor(e){super(),this.onerror=I,this.type=e}emit(e){xe(e)||I(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let r=0;const o=s=>(se(s),this.onerror(s),e),n=s=>{if(s!==void 0&&Zt(e,s))e=s;else if(s!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(r<t.length)try{return Promise.resolve(t[r++](e)).then(n,o)}catch(i){return o(i)}return e};return Promise.resolve(n(e))}return Promise.resolve(e)}};const re="Remote loading is disabled by experiments.optimization.disableRemote.";var Wo=class{constructor(){this.hooks=new F({})}formatAndRegisterRemote(){return[]}loadRemote(){throw new Error(re)}preloadRemote(){throw new Error(re)}registerRemotes(){throw new Error(re)}getRemoteModuleAndOptions(){throw new Error(re)}initRawContainer(){throw new Error(re)}};function Xt(e,t){const r=wt(t);r.url||I(Gt,P,{remoteName:e.name});let o=Le(t,r.url);!j&&!o.startsWith("http")&&(o=`https:${o}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=o,e.version=t.version,e.buildVersion=t.buildVersion}function Vo(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:o,origin:n,remoteInfo:s,id:i}=e;if(!Fe(t)||!Rt(t)){const{remoteSnapshot:a,globalSnapshot:c}=await n.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:je(t.name,o)});Xt(s,a);const l=[{nameOrAlias:r,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1,recordPreloadedAssets:!0}];await n.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:l,options:n.options,origin:n});const[u]=l;if(u){const f={remote:t,preloadConfig:u},d=await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:n,preloadOptions:f,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});d&&Jt(s,n,d,!1,{initiator:"loadRemote",id:i},u.recordPreloadedAssets).catch(()=>{})}return{...e,remoteSnapshot:a}}return e}}}function qo(e){const t=e.split(":");return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function Yt(e,t,r,o,n={},s){const{value:i}=q(e,ie(t)),a=s||i;if(a&&!ft(a)&&(r(a,t,o),a.remotesInfo)){const c=Object.keys(a.remotesInfo);for(const l of c){if(n[l])continue;n[l]=!0;const u=qo(l),f=a.remotesInfo[l];Yt(e,{name:u.name,version:f.matchedVersion},r,!1,n,void 0)}}}const Ae=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function zo(e,t,r,o,n){const s=[],i=[],a=[],c=new Set,l=new Set,{options:u}=e,{preloadConfig:f}=t,{depsRemote:d}=f;if(Yt(o,r,(h,p,y)=>{var b;let g;if(y)g=f;else if(Array.isArray(d)){const $=d.find(w=>w.nameOrAlias===p.name||w.nameOrAlias===p.alias);if(!$)return;g=Kt($)}else if(d===!0)g=f;else return;const _=Le(h,wt(h).url);_&&a.push({name:p.name,moduleInfo:{name:p.name,entry:_,type:"remoteEntryType"in h?h.remoteEntryType:"global",entryGlobalName:"globalName"in h?h.globalName:p.name,shareScope:"",version:"version"in h?h.version:void 0},url:_});let E="modules"in h?h.modules:[];const R=xo(g.exposes);R.length&&"modules"in h&&(E=(b=h==null?void 0:h.modules)==null?void 0:b.reduce(($,w)=>((R==null?void 0:R.indexOf(w.moduleName))!==-1&&$.push(w),$),[]));function S($){const w=$.map(k=>Le(h,k));return g.filter?w.filter(g.filter):w}if(E){const $=E.length;for(let w=0;w<$;w++){const k=E[w],z=`${p.name}/${k.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:k.moduleName==="."?p.name:z,name:p.name,remoteSnapshot:h,preloadConfig:g,remote:p,origin:e}),!Gr(z)&&(g.resourceCategory==="all"?(s.push(...S(k.assets.css.async)),s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.async)),i.push(...S(k.assets.js.sync))):g.resourceCategory==="sync"&&(s.push(...S(k.assets.css.sync)),i.push(...S(k.assets.js.sync))),Ur(z))}}},!0,{},n),n.shared&&n.shared.length>0){const h=(p,y)=>{const{shared:g}=Se(e.shareScopeMap,y.sharedName,p,e.sharedHandler.hooks.lifecycle.resolveShare)||{};g&&typeof g.lib=="function"&&(y.assets.js.sync.forEach(_=>{c.add(_)}),y.assets.css.sync.forEach(_=>{l.add(_)}))};n.shared.forEach(p=>{var _;const y=(_=u.shared)==null?void 0:_[p.sharedName];if(!y)return;const g=p.version?y.find(E=>E.version===p.version):y;g&&bt(g).forEach(E=>{h(E,p)})})}const m=i.filter(h=>!c.has(h)&&!Ae("script",h));return{cssAssets:s.filter(h=>!l.has(h)&&!Ae("link",h)),jsAssetsWithoutEntry:m,entryAssets:a.filter(h=>!Ae("script",h.url))}}const Ko=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:o,remote:n,globalSnapshot:s,remoteSnapshot:i}=e;return j?Fe(n)&&Rt(n)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:n.name,url:n.entry,moduleInfo:{name:o.name,entry:n.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(Xt(o,i),zo(t,r,o,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Qt(e,t){const r=ge({name:t.name,version:t.options.version}),o=r&&"remotesInfo"in r&&r.remotesInfo&&q(r.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:ze(),remoteSnapshot:ge({name:e.name,version:"version"in e?e.version:void 0})}}var Jo=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new F({beforeLoadRemoteSnapshot:new v("beforeLoadRemoteSnapshot"),loadSnapshot:new x("loadGlobalSnapshot"),loadRemoteSnapshot:new x("loadRemoteSnapshot"),afterLoadSnapshot:new x("afterLoadSnapshot"),beforeLoadManifest:new v("beforeLoadManifest"),afterLoadManifest:new v("afterLoadManifest")}),this.manifestLoading=we.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:r="loadRemote"}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e,origin:this.HostInstance});let n=ge({name:this.HostInstance.options.name,version:this.HostInstance.options.version});n||(n={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Fr({[this.HostInstance.options.name]:n})),n&&"remotesInfo"in n&&!q(n.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(n.remotesInfo={...n==null?void 0:n.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:l}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let u,f;if(c)if(ft(c)){const d=j?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",m=await this.loadManifestSnapshot(d,e,{},{initiator:r,id:t||e.name}),h=Ke({...e,entry:d},m);u=m,f=h}else{const{remoteSnapshot:d}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});u=d,f=l}else if(Fe(e)){const d=await this.loadManifestSnapshot(e.entry,e,{},{initiator:r,id:t||e.name}),m=Ke(e,d);u=d,f=m}else I(Ft,P,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(l)},void 0,H(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:u}),{remoteSnapshot:u,globalSnapshot:f}}getGlobalRemoteInfo(e){return Qt(e,this.HostInstance)}async getManifestJson(e,t,r,o){return(async()=>{const s=Z(t);let i=this.manifestCache.get(e);if(i)return await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,cached:!0,origin:this.HostInstance}),i;await this.hooks.lifecycle.beforeLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,origin:this.HostInstance});let a,c,l=!1;try{let d=await this.loaderHook.lifecycle.fetch.emit(e,{},s,o?{...o,url:e,resourceType:"manifest"}:void 0);(!d||!(d instanceof Response))&&(d=await fetch(e,{})),a=d,i=await d.json()}catch(d){c=d,i=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:d,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),i||(delete this.manifestLoading[e],await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,response:a,error:d,origin:this.HostInstance}),I(Ct,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${d}`,H(this.HostInstance.options))),l=!0}const u=[!i.metaData&&"metaData",!i.exposes&&"exposes",!i.shared&&"shared"].filter(Boolean),f=u.length>0?new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${u.join(", ")}.`):void 0;return f&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:f,from:"runtime",lifecycle:"afterResolve",remote:s,origin:this.HostInstance}),await this.hooks.lifecycle.afterLoadManifest.emit({manifestUrl:e,moduleInfo:t,resourceOptions:o,manifestJson:i,response:a,error:f||c,recovered:f?void 0:l||void 0,origin:this.HostInstance}),f&&I(Ut,P,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:u.join(",")},void 0,H(this.HostInstance.options)),this.manifestCache.set(e,i),i})()}async loadManifestSnapshot(e,t,r,o){const n=async()=>{const s=await this.getManifestJson(e,t,r,o),i=hr(s,{version:e}),{remoteSnapshot:a}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:s,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return a};return this.manifestLoading[e]||(this.manifestLoading[e]=n().then(s=>s)),this.manifestLoading[e]}},Zo=class{constructor(){this.hooks=new F({})}},Xo=class{constructor(e){this.hooks=new F({beforeRegisterShare:new Y("beforeRegisterShare"),afterRegisterShare:new A("afterRegisterShare"),afterResolve:new x("afterResolve"),beforeLoadShare:new x("beforeLoadShare"),loadShare:new v,afterLoadShare:new A("afterLoadShare"),errorLoadShare:new A("errorLoadShare"),resolveShare:new Y("resolveShare"),initContainerShareScopeMap:new Y("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterRegisterShare(e,t){this.hooks.lifecycle.afterRegisterShare.emit({pkgName:e,...t,shareScopeMap:this.shareScopeMap,origin:this.host})}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:r,selectedShared:o,loadContext:n}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:r,selectedShared:o,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,loadContext:n,origin:this.host})}catch(s){se(s)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:r,error:o,recovered:n,loadContext:s}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:o,recovered:n,loadContext:s})}catch(i){se(i)}}registerShared(e,t){const{newShareInfos:r,allShareInfos:o}=Pt(e,t);return Object.keys(r).forEach(n=>{r[n].forEach(s=>{s.scope.forEach(i=>{var l,u,f;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:n,shared:s});const a=(l=this.shareScopeMap[i])==null?void 0:l[n],c=a==null?void 0:a[s.version];a||this.setShared({pkgName:n,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name}),this.emitAfterRegisterShare(n,{scope:i,shared:s,previousShared:c,registeredShared:(f=(u=this.shareScopeMap[i])==null?void 0:u[n])==null?void 0:f[s.version],trigger:"runtime"})})})}),{newShareInfos:r,allShareInfos:o}}async loadShare(e,t){const{host:r}=this;let o=t==null?void 0:t.context;const n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});let s=n;try{n!=null&&n.scope&&await Promise.all(n.scope.map(async u=>{await Promise.all(this.initializeSharing(u,{strategy:n.strategy,context:o}))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r,loadContext:o});s=i.shareInfo,o=i.loadContext||o,L(s,`Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const a=s,{shared:c,useTreesShaking:l}=Se(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare,o)||{};if(c){const u=de(c,l);if(u.lib)return J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),u.lib;if(u.loading&&!u.loaded){const f=await u.loading;return u.loaded=!0,u.lib||(u.lib=f),J(u,r.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),f}else{const d=(async()=>{const h=await u.get();return J(u,r.options.name),u.loaded=!0,u.lib=h,h})();this.setShared({pkgName:e,loaded:!1,shared:c,from:r.options.name,lib:null,loading:d,treeShaking:l?u:void 0});const m=await d;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:c,loadContext:o}),m}}else{if(t!=null&&t.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,recovered:!0,loadContext:o}),!1;const u=ae(a.treeShaking),f=de(a,u),m=(async()=>{const p=await f.get();f.lib=p,f.loaded=!0,J(f,r.options.name);const{shared:y,useTreesShaking:g}=Se(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare,o)||{};if(y){const _=de(y,g);_.lib=p,_.loaded=!0,y.from=a.from}return p})();this.setShared({pkgName:e,loaded:!1,shared:a,from:r.options.name,lib:null,loading:m,treeShaking:u?f:void 0});const h=await m;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:a,selectedShared:a,loadContext:o}),h}}catch(i){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:i,loadContext:o}),i}}initializeSharing(e=le,t){var m;const{host:r}=this,o=t==null?void 0:t.from,n=t==null?void 0:t.strategy,s=((m=t==null?void 0:t.context)==null?void 0:m.trigger)||o||"runtime";let i=t==null?void 0:t.initScope;const a=[];if(o!=="build"){const{initTokens:h}=this;i||(i=[]);let p=h[e];if(p||(p=h[e]={from:this.host.name}),i.indexOf(p)>=0)return a;i.push(p)}const c=this.shareScopeMap,l=r.options.name;c[e]||(c[e]={});const u=c[e],f=(h,p)=>{var b;const{version:y,eager:g}=p;u[h]=u[h]||{};const _=u[h],E=_[y],R=E&&de(E),S=!!(R&&("eager"in R&&R.eager||"shareConfig"in R&&((b=R.shareConfig)!=null&&b.eager)));(!R||R.strategy!=="loaded-first"&&!R.loaded&&(!g!=!S?g:l>_[y].from))&&(_[y]=p),this.emitAfterRegisterShare(h,{scope:e,shared:p,previousShared:E,registeredShared:_[y],trigger:s})},d=async h=>{const{module:p}=await r.remoteHandler.getRemoteModuleAndOptions({id:h});let y;const g={initiator:"loadShare",id:h,resourceType:"remoteEntry",url:p.remoteInfo.entry};try{y=await p.getEntry(void 0,g)}catch(_){if(y=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:h,error:_,from:"runtime",lifecycle:"beforeLoadShare",remote:p.remoteInfo,origin:r}),!y)return}finally{y!=null&&y.init&&!p.initing&&(p.remoteEntryExports=y,await p.init(void 0,void 0,i,void 0,g))}};return Object.keys(r.options.shared).forEach(h=>{r.options.shared[h].forEach(p=>{p.scope.includes(e)&&f(h,p)})}),(r.options.shareStrategy==="version-first"||n==="version-first")&&r.options.remotes.forEach(h=>{h.shareScope===e&&a.push(d(h.name))}),a}loadShareSync(e,t){const{host:r}=this,o=t==null?void 0:t.context,n=et({pkgName:e,extraOptions:t,shareInfos:r.options.shared});try{n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy,from:t==null?void 0:t.from,context:o})});const{shared:s}=Se(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare,o)||{};if(s){if(typeof s.lib=="function")return J(s,r.options.name),s.loaded||(s.loaded=!0,s.from===r.options.name&&(n.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),s.lib;if(typeof s.get=="function"){const i=s.get();if(!(i instanceof Promise))return J(s,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:s,loadContext:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&I((t==null?void 0:t.from)==="build"?Ht:De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,selectedShared:n,loadContext:o}),n.lib}I(De,P,{hostName:r.options.name,sharedPkgName:e},void 0,H(r.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:n,error:s,loadContext:o}),s}}initShareScopeMap(e,t,r={}){const{host:o}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:o.options,origin:o,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:o,loading:n,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...u}=t,f=Array.isArray(l)?l:[l],d=m=>{const h=(y,g,_)=>{_&&!y[g]&&(y[g]=_)},p=a?m.treeShaking:m;h(p,"loaded",s),h(p,"loading",n),h(p,"get",i),h(p,"lib",o)};f.forEach(m=>{this.shareScopeMap[m]||(this.shareScopeMap[m]={}),this.shareScopeMap[m][e]||(this.shareScopeMap[m][e]={}),this.shareScopeMap[m][e][c]||(this.shareScopeMap[m][e][c]={version:c,scope:[m],...u,lib:o});const h=this.shareScopeMap[m][e][c];d(h),r&&h.from!==r&&(h.from=r)})}_setGlobalShareScopeMap(e){const t=kt(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},Yo=class{constructor(){this.shareScopeMap={},this.hooks=new F({afterResolve:new x("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}},Qo=class{constructor(e){this.hooks=new F({beforeRegisterRemote:new Y("beforeRegisterRemote"),registerRemote:new Y("registerRemote"),beforeRequest:new x("beforeRequest"),afterMatchRemote:new v("afterMatchRemote"),onLoad:new v("onLoad"),afterLoadRemote:new v("afterLoadRemote"),handlePreloadModule:new A("handlePreloadModule"),errorLoadRemote:new v("errorLoadRemote"),beforePreloadRemote:new v("beforePreloadRemote"),generatePreloadAssets:new v("generatePreloadAssets"),afterPreloadRemote:new v("afterPreloadRemote"),loadEntry:new v}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,o)=>(this.registerRemote(o,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:o}=t,{name:n,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:o},s&&e.startsWith(n)){const i=e.replace(n,s);this.idToRemoteMap[i]={name:r.name,expose:o};return}if(s&&e.startsWith(s)){const i=e.replace(s,n);this.idToRemoteMap[i]={name:r.name,expose:o}}}async loadRemote(e,t){const{host:r}=this,o=tt(r.options.remotes,e);let n=e,s=o==null?void 0:o.expose,i=o?Z(o.remote):void 0,a;try{const{loadFactory:c=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:f}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:d,remote:m,expose:h,id:p,remoteSnapshot:y}=f;n=p,s=h,i=Z(m);const g=await l.get(p,h,t,y),_=await this.hooks.lifecycle.onLoad.emit({id:p,pkgNameOrAlias:d,expose:h,exposeModule:c?g:void 0,exposeModuleFactory:c?void 0:g,remote:m,options:u,moduleInstance:l,origin:r});return this.setIdToRemoteMap(e,f),a={id:n,expose:s,remote:i,options:t,origin:r},typeof _=="function"?_:g}catch(c){const{from:l="runtime"}=t||{from:"runtime"};let u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:c,from:l,lifecycle:"onLoad",expose:s,remote:i,origin:r})}catch(f){throw a={id:n,expose:s,remote:i,options:t,error:f,origin:r},f}if(!u)throw a={id:n,expose:s,remote:i,options:t,error:c,origin:r},c;return a={id:n,expose:s,remote:i,options:t,error:c,origin:r,recovered:!0},u}finally{a&&await this.hooks.lifecycle.afterLoadRemote.emit(a)}}async preloadRemote(e){const{host:t}=this,r=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const o=Fo(t.options.remotes,e),n=a=>{const{preloadConfig:c,remote:l}=a,u=c.exposes||[];return u.length?u.map(f=>({ops:{...a,preloadConfig:{...c,exposes:[f]}},id:je(l.name,f)})):[{ops:a,id:`${l.name}/*`}]};let s;await Promise.all(o.flatMap(n).map(async a=>{const{ops:c,id:l}=a,{remote:u,preloadConfig:f}=c,d=Z(u);try{const{globalSnapshot:m,remoteSnapshot:h}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:u,id:l,initiator:"preloadRemote"}),p=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:c,remote:u,remoteInfo:d,globalSnapshot:m,remoteSnapshot:h});if(!p)return;const y=await Jt(d,t,p,!0,{initiator:"preloadRemote",id:l},f.recordPreloadedAssets);r.push({remote:u,remoteInfo:d,preloadConfig:f,id:l,results:y})}catch(m){r.push({remote:u,remoteInfo:d,preloadConfig:f,id:l,results:[{url:d.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(d.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:l,error:m}]})}}));const i=r.flatMap(a=>a.results.filter(c=>c.status==="error"||c.status==="timeout"));if(i.length>0&&(s=new Error(`preloadRemote failed to load ${i.length} resource(s).`),Object.assign(s,{results:r,failedResults:i})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:r,error:s}),s)throw s}registerRemotes(e,t){const{host:r}=this;e.forEach(o=>{this.registerRemote(o,r.options.remotes,{force:t==null?void 0:t.force})})}initRawContainer(e,t,r){const{host:o}=this,n=new ot({host:o,remoteInfo:Z({name:e,entry:t})});return n.remoteEntryExports=r,o.moduleCache.set(e,n),n}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(m){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:m,lifecycle:"beforeRequest"}),!o)throw m}const{id:n}=o,s=tt(t.options.remotes,n);if(!s)try{I(Dt,P,{hostName:t.options.name,requestId:n},void 0,H(t.options))}catch(m){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:n,options:t.options,error:m,origin:t}),m}const{remote:i}=s,a=Z(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:u}=c;L(l&&u,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);let f=t.moduleCache.get(l.name);const d={host:t,remoteInfo:a};return f||(f=new ot(d),t.moduleCache.set(l.name,f)),{module:f,moduleOptions:d,remoteMatchInfo:c}}registerRemote(e,t,r){const{host:o}=this,n=()=>{if(e.alias){const i=t.find(a=>{var c;return e.alias&&(a.name.startsWith(e.alias)||((c=a.alias)==null?void 0:c.startsWith(e.alias)))});L(!i,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i&&i.name} name or alias`)}"entry"in e&&j&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=le),e.type||(e.type=Mt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const s=t.find(i=>i.name===e.name);if(!s)n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];r!=null&&r.force&&(this.removeRemote(s),n(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),lt(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:o}=e,n=r.options.remotes.findIndex(c=>c.name===o);n!==-1&&r.options.remotes.splice(n,1);const s=q(T.__FEDERATION__.moduleInfo,ie(e)).key;delete T.__FEDERATION__.moduleInfo[s],"entry"in e&&(r.snapshotHandler.manifestCache.delete(e.entry),delete we.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);const{hostGlobalSnapshot:i}=Qt(e,r);if(i){const c=i&&"remotesInfo"in i&&i.remotesInfo&&q(i.remotesInfo,e.name).key;c&&delete i.remotesInfo[c]}const a=r.moduleCache.get(e.name);if(a){const c=a.remoteInfo,l=c.entryGlobalName;T[l]&&((t=Object.getOwnPropertyDescriptor(T,l))!=null&&t.configurable?delete T[l]:T[l]=void 0);const u=zt(a.remoteInfo);G[u]&&delete G[u];let f=c.buildVersion?ct(c.name,c.buildVersion):c.name;const d=T.__FEDERATION__.__INSTANCES__.findIndex(m=>c.buildVersion?m.options.id===f:m.name===f);if(d!==-1){const m=T.__FEDERATION__.__INSTANCES__[d];f=m.options.id||f;const h=kt();let p=!0;const y=[];Object.keys(h).forEach(g=>{const _=h[g];_&&Object.keys(_).forEach(E=>{const R=_[E];R&&Object.keys(R).forEach(S=>{const b=R[S];b&&Object.keys(b).forEach($=>{const w=b[$];w&&typeof w=="object"&&w.from===c.name&&(w.loaded||w.loading?(w.useIn=w.useIn.filter(k=>k!==c.name),w.useIn.length?p=!1:y.push([g,E,S,$])):y.push([g,E,S,$]))})})})}),p&&(m.shareScopeMap={},delete h[f]),y.forEach(([g,_,E,R])=>{var S,b,$;($=(b=(S=h[g])==null?void 0:S[_])==null?void 0:b[E])==null||delete $[R]}),T.__FEDERATION__.__INSTANCES__.splice(d,1)}r.moduleCache.delete(e.name)}}catch(r){Ce.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const en=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Me=typeof FEDERATION_OPTIMIZE_NO_REMOTE=="boolean"?!FEDERATION_OPTIMIZE_NO_REMOTE:!0,nt=typeof FEDERATION_OPTIMIZE_NO_SHARED=="boolean"?!FEDERATION_OPTIMIZE_NO_SHARED:!0;var tn=class{constructor(e){this.hooks=new F({beforeInit:new Y("beforeInit"),init:new A,beforeInitContainer:new x("beforeInitContainer"),initContainer:new x("initContainer")}),this.version="0.0.0-perf-website-code-usage-20260914033703",this.moduleCache=new Map,this.loaderHook=new F({getModuleInfo:new A,createScript:new A,createLink:new A,fetch:new v,loadEntryError:new v,afterLoadEntry:new v("afterLoadEntry"),beforeInitRemote:new v("beforeInitRemote"),afterInitRemote:new v("afterInitRemote"),beforeGetExpose:new v("beforeGetExpose"),afterGetExpose:new v("afterGetExpose"),beforeExecuteFactory:new v("beforeExecuteFactory"),afterExecuteFactory:new v("afterExecuteFactory"),getModuleFactory:new v}),this.bridgeHook=new F({beforeBridgeRender:new A,afterBridgeRender:new A,beforeBridgeDestroy:new A,afterBridgeDestroy:new A,afterBridgeRouteSync:new A});const t=Me&&en?[Vo(),Ko()]:[],r={id:Lo(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:j};this.name=e.name,this.options=r,this.snapshotHandler=Me?new Jo(this):new Zo,this.sharedHandler=nt?new Xo(this):new Yo,this.remoteHandler=Me?new Qo(this):new Wo,this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...r.plugins,...e.plugins||[]]),this.options=this.formatOptions(r,e)}initOptions(e){e.name&&e.name!==this.options.name&&I(_t(xt,P)),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=le,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){return this.remoteHandler.initRawContainer(e,t,r)}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,r={}){this.sharedHandler.initShareScopeMap(e,t,r)}formatOptions(e,t){const r=nt?Pt(e,t).allShareInfos:{},{userOptions:o,options:n}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(n,o),{allShareInfos:i}=this.sharedHandler.registerShared(n,o),a=[...n.plugins];o.plugins&&o.plugins.forEach(l=>{a.includes(l)||a.push(l)});const c={...e,...t,plugins:a,remotes:s,shared:i,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){this.options.plugins=Do(e,this)}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let rn=null;function er(e){return rn}Dr(tn);function tr(e,t){const r=o=>{if(!o.startsWith("/"))return o;const n=o.length>1&&o.endsWith("/"),s=`${t}/${o}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/";return n?`${s}/`:s};return e.map(o=>{const n={...o,path:r(o.path)};return typeof o.redirect=="string"?n.redirect=r(o.redirect):o.redirect&&typeof o.redirect=="object"&&"path"in o.redirect&&typeof o.redirect.path=="string"&&(n.redirect={...o.redirect,path:r(o.redirect.path)}),o.children&&o.children.length>0&&(n.children=tr(o.children,t)),n})}function on(e){const t=e.replace(/\/+$/,""),r=s=>s.startsWith("/")&&s!==t&&!s.startsWith(t+"/"),o=s=>`${t}${s}`.replace(/\/+/g,"/"),n=s=>typeof s=="string"?r(s)?o(s):s:"path"in s&&typeof s.path=="string"&&r(s.path)?{...s,path:o(s.path)}:s;return s=>{const i=s.push.bind(s),a=s.replace.bind(s),c=s.resolve.bind(s);s.push=l=>i(n(l)),s.replace=l=>a(n(l)),s.resolve=(l,...u)=>c(n(l),...u)}}function nn(e){const{router:t,basename:r,memoryRoute:o,hashRoute:n}=e,s=t.getRoutes().sort((m,h)=>m.path.split("/").filter(p=>p).length-h.path.split("/").filter(p=>p).length),i=new Map,a=new Set;s.forEach(m=>{const h=i.get(m.path)||[];h.push(m),i.set(m.path,h)});const c=(m,h)=>`${m}/${h}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",l=(m,h="")=>{if(!m.children||m.children.length===0)return m;for(let p=0;p<m.children.length;p++){const y=m.children[p],g=c(h,y.path),E=(i.get(g)||[]).find(R=>!a.has(R)&&R!==m&&(y.name==null||R.name===y.name));if(E){const R={...E,path:y.path};m.children[p]=R,a.add(E),l(R,g)}}return m};let u=[];for(const m of s)if(!a.has(m)){const h=l(m,m.path);a.add(m),u.push(h)}let f,d;return o?f=pe.createMemoryHistory(r):n?(f=pe.createWebHashHistory(),r&&(u=tr(u,r),d=on(r))):f=pe.createWebHistory(r),{history:f,routes:u,patchRouter:d}}function sn(e){const t=new Map,r=er();return()=>({__APP_VERSION__:"0.0.0-perf-website-code-usage-20260914033703",async render(o){var p,y,g,_,E,R,S,b,$;D.debug("createBridgeComponent render Info",o);const{moduleName:n,dom:s,basename:i,memoryRoute:a,hashRoute:c,...l}=o,u={side:"producer",framework:"vue",operation:t.has(s)?"update":"render",reason:"direct"},f=ir.createApp(e.rootComponent,l);t.set(s,f);const d=await((g=(y=(p=r==null?void 0:r.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:g.emit(o,u)),m=d&&typeof d=="object"&&(d!=null&&d.extraProps)?d==null?void 0:d.extraProps:{},h=e.appOptions({app:f,basename:i,memoryRoute:a,hashRoute:c,...l,...m});if(h!=null&&h.router){const{history:w,routes:k,patchRouter:z}=nn({router:h.router,basename:o.basename,memoryRoute:o.memoryRoute,hashRoute:o.hashRoute}),ee=pe.createRouter({...h.router.options,history:w,routes:k});if(z&&z(ee),h.afterRouterCreate&&h.afterRouterCreate(ee),D.debug("createBridgeComponent render router info>>>",{moduleName:n,router:ee}),a){const or={action:"memory-route-init",to:a.entryPath,basename:i},nr={side:"producer",framework:"vue",operation:"route-sync",moduleName:n,route:or},sr=await ee.push(a.entryPath);(R=(E=(_=r==null?void 0:r.bridgeHook)==null?void 0:_.lifecycle)==null?void 0:E.afterBridgeRouteSync)==null||R.emit({context:nr,result:sr})}f.use(ee)}f.mount(s),($=(b=(S=r==null?void 0:r.bridgeHook)==null?void 0:S.lifecycle)==null?void 0:b.afterBridgeRender)==null||$.emit(o,{context:u})},destroy(o){var i,a,c,l,u,f;D.debug("createBridgeComponent destroy Info",o);const n=t.get(o==null?void 0:o.dom),s={side:"producer",framework:"vue",operation:"destroy",reason:"direct"};(c=(a=(i=r==null?void 0:r.bridgeHook)==null?void 0:i.lifecycle)==null?void 0:a.beforeBridgeDestroy)==null||c.emit(o,s),n==null||n.unmount(),(f=(u=(l=r==null?void 0:r.bridgeHook)==null?void 0:l.lifecycle)==null?void 0:u.afterBridgeDestroy)==null||f.emit(o,{context:s})}})}function an(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const cn=N.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=N.ref(null),r=N.ref(null),o=N.ref(""),n=N.ref(!1),s=N.ref(!1),i=N.ref(!1),a=He.useRoute(),c=er(),l=N.useAttrs(),u=()=>({name:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute}),f=async()=>{var _,E,R,S,b,$,w;if(!t.value||n.value)return;const h=(_=e.providerInfo)==null?void 0:_.call(e);r.value=h;let p={...l,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",p);const y={side:"consumer",framework:"vue",operation:"render"},g=await((S=(R=(E=c==null?void 0:c.bridgeHook)==null?void 0:E.lifecycle)==null?void 0:R.beforeBridgeRender)==null?void 0:S.emit(p,y))||{};p={...p,...g.extraProps},h.render(p),n.value=!0,(w=($=(b=c==null?void 0:c.bridgeHook)==null?void 0:b.lifecycle)==null?void 0:$.afterBridgeRender)==null||w.emit(p,{context:y})},d=()=>{var g,_,E,R,S,b;const h=r.value;if(!h||!n.value)return;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e});const p=u(),y={side:"consumer",framework:"vue",operation:"destroy"};(E=(_=(g=c==null?void 0:c.bridgeHook)==null?void 0:g.lifecycle)==null?void 0:_.beforeBridgeDestroy)==null||E.emit(p,y),h.destroy({dom:t.value,moduleName:e.moduleName}),r.value=null,n.value=!1,(b=(S=(R=c==null?void 0:c.bridgeHook)==null?void 0:R.lifecycle)==null?void 0:S.afterBridgeDestroy)==null||b.emit(p,{context:y})},m=N.watch(()=>a==null?void 0:a.path,h=>{var p,y,g;if(s.value&&o.value!==""&&o.value!==h){D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:a.path});const _={action:"host-to-remote",mechanism:"popstate",from:o.value,to:h,basename:e.basename},E={side:"consumer",framework:"vue",operation:"route-sync",moduleName:e.moduleName,route:_};an(),(g=(y=(p=c==null?void 0:c.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.afterBridgeRouteSync)==null||g.emit({context:E})}o.value=h});return N.onMounted(()=>{s.value=!0,f()}),N.onActivated(async()=>{s.value=!0,i.value&&(i.value=!1,await N.nextTick(),f())}),N.onDeactivated(()=>{s.value=!1,i.value=!0,d()}),N.onBeforeUnmount(()=>{m(),d()}),()=>N.createVNode("div",N.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function rr(e){return N.defineAsyncComponent({__APP_VERSION__:"0.0.0-perf-website-code-usage-20260914033703",...e.asyncComponentOptions,loader:async()=>{var c,l;const t=He.useRoute();let r="/";const o=(l=(c=t==null?void 0:t.matched)==null?void 0:c[0])==null?void 0:l.path;o&&(o.endsWith("/:pathMatch(.*)*")?r=o.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const n=(e==null?void 0:e.export)||"default";D.debug("createRemoteAppComponent LazyComponent create >>>",{basename:r,info:e});const s=await e.loader(),i=s&&s[Symbol.for("mf_module_id")],a=s[n];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:n,basename:r,route:t}),n in s&&typeof a=="function")return{render(){return N.h(cn,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute})}};throw new Error("module not found")}})}function ln(e){return D.warn("createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"),rr(e)}exports.createBridgeComponent=sn;exports.createRemoteAppComponent=rr;exports.createRemoteComponent=ln;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,60 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare type AddOptionsFnParams = {
|
|
7
|
-
app: Vue.App<Vue.Component>;
|
|
8
|
-
basename: RenderFnParams['basename'];
|
|
9
|
-
memoryRoute: RenderFnParams['memoryRoute'];
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export declare function createBridgeComponent(bridgeInfo: ProviderFnParams): () => {
|
|
14
|
-
__APP_VERSION__: string;
|
|
15
|
-
render(info: RenderFnParams): Promise<void>;
|
|
16
|
-
destroy(info: {
|
|
17
|
-
dom: HTMLElement;
|
|
18
|
-
}): void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export declare function createRemoteAppComponent(info: {
|
|
22
|
-
loader: () => Promise<any>;
|
|
23
|
-
export?: string;
|
|
24
|
-
asyncComponentOptions?: Omit<AsyncComponentOptions, 'loader'>;
|
|
25
|
-
rootAttrs?: Record<string, unknown>;
|
|
26
|
-
}): new () => ComponentPublicInstance;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated createRemoteAppComponent is deprecated, please use createRemoteAppComponent instead!
|
|
30
|
-
*/
|
|
31
|
-
export declare function createRemoteComponent(info: {
|
|
32
|
-
loader: () => Promise<any>;
|
|
33
|
-
export?: string;
|
|
34
|
-
asyncComponentOptions?: Omit<AsyncComponentOptions, 'loader'>;
|
|
35
|
-
rootAttrs?: Record<string, unknown>;
|
|
36
|
-
}): new () => ComponentPublicInstance;
|
|
37
|
-
|
|
38
|
-
declare type ProviderFnParams = {
|
|
39
|
-
rootComponent: Vue.Component;
|
|
40
|
-
appOptions: (params: AddOptionsFnParams) => {
|
|
41
|
-
router?: VueRouter.Router;
|
|
42
|
-
} | void;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
declare interface ProviderParams {
|
|
46
|
-
moduleName?: string;
|
|
47
|
-
basename?: string;
|
|
48
|
-
memoryRoute?: {
|
|
49
|
-
entryPath: string;
|
|
50
|
-
};
|
|
51
|
-
hashRoute?: boolean;
|
|
52
|
-
style?: React.CSSProperties;
|
|
53
|
-
className?: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export declare interface RenderFnParams extends ProviderParams {
|
|
57
|
-
dom: HTMLElement;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { }
|
|
1
|
+
export { createBridgeComponent } from './provider';
|
|
2
|
+
export type { ProviderFnParams } from './provider';
|
|
3
|
+
export { createRemoteComponent, createRemoteAppComponent } from './create';
|
|
4
|
+
export type { RenderFnParams } from '@module-federation/bridge-shared';
|