@module-federation/bridge-vue3 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -2
- package/dist/index.cjs +6 -6
- package/dist/index.js +808 -748
- package/package.json +4 -5
- package/project.json +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @module-federation/bridge-vue3
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [c856ec1]
|
|
8
|
+
- Updated dependencies [12240bb]
|
|
9
|
+
- Updated dependencies [e5dd6ef]
|
|
10
|
+
- @module-federation/sdk@2.2.0
|
|
11
|
+
- @module-federation/runtime@2.2.0
|
|
12
|
+
- @module-federation/bridge-shared@2.2.0
|
|
13
|
+
|
|
3
14
|
## 2.1.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -203,7 +214,6 @@
|
|
|
203
214
|
### Patch Changes
|
|
204
215
|
|
|
205
216
|
- a7cf276: chore: upgrade NX to 21.2.3, Storybook to 9.0.9, and TypeScript to 5.8.3
|
|
206
|
-
|
|
207
217
|
- Upgraded NX from 21.0.3 to 21.2.3 with workspace configuration updates
|
|
208
218
|
- Migrated Storybook from 8.3.5 to 9.0.9 with updated configurations and automigrations
|
|
209
219
|
- Upgraded TypeScript from 5.7.3 to 5.8.3 with compatibility fixes
|
|
@@ -365,7 +375,6 @@
|
|
|
365
375
|
### Patch Changes
|
|
366
376
|
|
|
367
377
|
- 6bc13cf: Fixed several issues:
|
|
368
|
-
|
|
369
378
|
1. Resolved inconsistencies in naming between `name` and `moduleName` to align with the type defined in `packages/bridge/bridge-shared/src/type.ts`. This also fixed an issue where `name` was being passed to the remote component, and if it was `<router-view>`, it caused rendering issues.
|
|
370
379
|
2. Issue: When passing props from a Vue 3 host application to a Vue 3 remote application created with `createRemoteComponent`, the props were being applied as attributes on the root container instead of being passed to the remote component.
|
|
371
380
|
Fix: Set `inheritAttrs: false` in `remoteApp.tsx` and explicitly pass all attributes to the remote component using `useAttrs()`.
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),r=t.filter(n=>!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("vue"),Oe=require("vue-router");function ze(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Gt=ze(v),ce=ze(Oe),xt=".json",Ut="FEDERATION_DEBUG",Vt=":";let $e=function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e}({});const H=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function Je(){return H}function Xe(){return typeof navigator<"u"&&(navigator==null?void 0:navigator.product)==="ReactNative"}function Bt(){try{if(Je()&&window.localStorage)return!!localStorage.getItem(Ut)}catch{return!1}return!1}function we(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:Bt()}const Wt="[ Federation Runtime ]",Ye=function(...e){return e.length?e.reduce((t,r)=>r?t?`${t}${Vt}${r}`:r:t,""):""},Ne=(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?!Je()&&!Xe()&&"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),"")},Ze=e=>{console.warn(`${Wt}: ${e}`)};function Qe(e){try{return JSON.stringify(e,null,2)}catch{return""}}const oe=(e,t)=>{if(!e)return t;const n=(o=>{if(o===".")return"";if(o.startsWith("./"))return o.replace("./","");if(o.startsWith("/")){const s=o.slice(1);return s.endsWith("/")?s.slice(0,-1):s}return o})(e);return n?n.endsWith("/")?`${n}${t}`:`${n}/${t}`:t};function jt(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function qt(e,t={}){var E,b,N;const{remotes:r={},overrides:n={},version:o}=t;let s;const i=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&o?jt(o):e.metaData.publicPath:e.metaData.getPublicPath,a=Object.keys(n);let l={};Object.keys(r).length||(l=((E=e.remotes)==null?void 0:E.reduce((_,$)=>{let R;const w=$.federationContainerName;return a.includes(w)?R=n[w]:"version"in $?R=$.version:R=$.entry,_[w]={matchedVersion:R},_},{}))||{}),Object.keys(r).forEach(_=>l[_]={matchedVersion:a.includes(_)?n[_]:r[_]});const{remoteEntry:{path:c,name:f,type:h},types:u={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:d},globalName:m,ssrRemoteEntry:y}=e.metaData,{exposes:g}=e;let p={version:o||"",buildVersion:d,globalName:m,remoteEntry:oe(c,f),remoteEntryType:h,remoteTypes:oe(u.path,u.name),remoteTypesZip:u.zip||"",remoteTypesAPI:u.api||"",remotesInfo:l,shared:e==null?void 0:e.shared.map(_=>({assets:_.assets,sharedName:_.name,version:_.version,usedExports:_.referenceExports||[]})),modules:g==null?void 0:g.map(_=>({moduleName:_.name,modulePath:_.path,assets:_.assets}))};if((b=e.metaData)!=null&&b.prefetchInterface){const _=e.metaData.prefetchInterface;p={...p,prefetchInterface:_}}if((N=e.metaData)!=null&&N.prefetchEntry){const{path:_,name:$,type:R}=e.metaData.prefetchEntry;p={...p,prefetchEntry:oe(_,$),prefetchEntryType:R}}if("publicPath"in e.metaData?(s={...p,publicPath:i()},typeof e.metaData.ssrPublicPath=="string"&&(s.ssrPublicPath=e.metaData.ssrPublicPath)):s={...p,getPublicPath:i()},y){const _=oe(y.path,y.name);s.ssrRemoteEntry=_,s.ssrRemoteEntryType=y.type||"commonjs-module"}return s}function et(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(xt))}const Kt="[ Module Federation ]",X=console,zt=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Jt(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
|
|
2
|
+
`),r=t.filter(n=>!zt.some(o=>n.includes(o)));return r.length?`Stack trace:
|
|
3
3
|
${r.slice(0,5).join(`
|
|
4
|
-
`)}`:void 0}catch{return}}var
|
|
5
|
-
})`,{filename:E,importModuleDynamically:((l=h.constants)==null?void 0:l.USE_MAIN_CONTEXT_DEFAULT_LOADER)??V});let g;g=(await V("node:module")).createRequire(c.protocol==="file:"||c.protocol==="node:"?c.href:u.join(process.cwd(),"__mf_require_base__.js")),m.runInThisContext()(p.exports,p.module,g,y,E);const b=p.module.exports||p.exports;if(r&&b&&r.globalName){t(void 0,b[r.globalName]||b);return}t(void 0,b)}catch(f){t(f instanceof Error?f:new Error(`Script execution error: ${f}`))}};s().then(async a=>{if((r==null?void 0:r.type)==="esm"||(r==null?void 0:r.type)==="module")return Ne(o.href,{fetch:a,vm:await V("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,o)}).catch(a=>{t(a)})}:(e,t,r,n)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},Yt=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((r,n)=>{Xt(e,(o,s)=>{var i,a;if(o)n(o);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")},_e=new Map;async function Ne(e,t){if(_e.has(e))return _e.get(e);const{fetch:r,vm:n}=t,o=await(await r(e)).text(),s=new n.SourceTextModule(o,{importModuleDynamically:async(i,a)=>{const c=new URL(i,e).href;return Ne(c,t)}});return _e.set(e,s),await s.link(async i=>{const a=new URL(i,e).href;return await Ne(a,t)}),s}const D=et("[ Module Federation Bridge Vue3 ]"),j="[ Federation Runtime ]",Te=et(j);function T(e,t){e||O(t)}function O(e){throw e instanceof Error?(e.message.startsWith(j)||(e.message=`${j}: ${e.message}`),e):new Error(`${j}: ${e}`)}function Oe(e){e instanceof Error&&(e.message.startsWith(j)||(e.message=`${j}: ${e.message}`)),Te.warn(e)}function Zt(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function Q(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Le(e){return typeof e.entry<"u"}function st(e){return!e.entry.includes(".json")}function Me(e){return e&&typeof e=="object"}const Qt=Object.prototype.toString;function er(e){return Qt.call(e)==="[object Object]"}function it(e){return Array.isArray(e)?e:[e]}function at(e){const t={url:"",type:"global",globalName:""};return H()||ze()||!("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 tr=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},I=typeof globalThis=="object"?globalThis:window,k=(()=>{try{return document.defaultView}catch{return I}})(),ee=k;function le(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function ue(e,t){return Object.hasOwnProperty.call(e,t)}ue(I,"__GLOBAL_LOADING_REMOTE_ENTRY__")||le(I,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const W=I.__GLOBAL_LOADING_REMOTE_ENTRY__;function ct(e){var t,r,n,o,s,i;ue(e,"__VMOK__")&&!ue(e,"__FEDERATION__")&&le(e,"__FEDERATION__",e.__VMOK__),ue(e,"__FEDERATION__")||(le(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),le(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(n=e.__FEDERATION__).moduleInfo??(n.moduleInfo={}),(o=e.__FEDERATION__).__SHARE__??(o.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map)}ct(I);ct(k);function rr(e,t=we()){t&&(I.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.1.0")}function z(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const n of r){const[o,s]=n.split(":"),i=`${o}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else throw new Error("key must be string")}const Ge=()=>k.__FEDERATION__.moduleInfo,nr=(e,t)=>{const r=z(t,Q(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:n,...o}=e,s=Q(o),i=z(k.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===n)return i}},fe=e=>nr(e,k.__FEDERATION__.moduleInfo),Ue=(e,t)=>{const r=Q(e);return k.__FEDERATION__.moduleInfo[r]=t,k.__FEDERATION__.moduleInfo},or=e=>(k.__FEDERATION__.moduleInfo={...k.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete k.__FEDERATION__.moduleInfo[r]}),Ce=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:I[r]}},sr=()=>k.__FEDERATION__.__GLOBAL_PLUGIN__,ir=e=>I.__FEDERATION__.__PRELOADED_MAP__.get(e),ar=e=>I.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),xe="[0-9A-Za-z-]+",De=`(?:\\+(${xe}(?:\\.${xe})*))`,Z="0|[1-9]\\d*",he="[0-9]+",lt="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Be=`(?:${he}|${lt})`,cr=`(?:-?(${Be}(?:\\.${Be})*))`,Ve=`(?:${Z}|${lt})`,ut=`(?:-(${Ve}(?:\\.${Ve})*))`,be=`${Z}|x|X|\\*`,J=`[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ut})?${De}?)?)?`,lr=`^\\s*(${J})\\s+-\\s+(${J})\\s*$`,ur=`[v=\\s]*${`(${he})\\.(${he})\\.(${he})`}${cr}?${De}?`,Fe="((?:<|>)?=?)",fr=`(\\s*)${Fe}\\s*(${ur}|${J})`,ft="(?:~>?)",hr=`(\\s*)${ft}\\s+`,ht="(?:\\^)",dr=`(\\s*)${ht}\\s+`,pr="(<|>)?=?\\s*\\*",mr=`^${ht}${J}$`,yr=`v?${`(${Z})\\.(${Z})\\.(${Z})`}${ut}?${De}?`,Er=`^${ft}${J}$`,gr=`^${Fe}\\s*${J}$`,_r=`^${Fe}\\s*(${yr})$|^$`,br="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function N(e){return!e||e.toLowerCase()==="x"||e==="*"}function dt(...e){return t=>e.reduce((r,n)=>n(r),t)}function We(e){return e.match(C(_r))}function je(e,t,r,n){const o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}function Rr(e){return e.replace(C(lr),(t,r,n,o,s,i,a,c,l,f,d,u)=>(N(n)?r="":N(o)?r=`>=${n}.0.0`:N(s)?r=`>=${n}.${o}.0`:r=`>=${r}`,N(l)?c="":N(f)?c=`<${Number(l)+1}.0.0-0`:N(d)?c=`<${l}.${Number(f)+1}.0-0`:u?c=`<=${l}.${f}.${d}-${u}`:c=`<=${c}`,`${r} ${c}`.trim()))}function Sr(e){return e.replace(C(fr),"$1$2$3")}function $r(e){return e.replace(C(hr),"$1~")}function wr(e){return e.replace(C(dr),"$1^")}function Ir(e){return e.trim().split(/\s+/).map(t=>t.replace(C(mr),(r,n,o,s,i)=>N(n)?"":N(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:N(s)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:i?n==="0"?o==="0"?`>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s}-${i} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${s} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${Number(n)+1}.0.0-0`)).join(" ")}function Nr(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Er),(r,n,o,s,i)=>N(n)?"":N(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:N(s)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:i?`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`)).join(" ")}function Tr(e){return e.split(/\s+/).map(t=>t.trim().replace(C(gr),(r,n,o,s,i,a)=>{const c=N(o),l=c||N(s),f=l||N(i);return n==="="&&f&&(n=""),a="",c?n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(l&&(s=0),i=0,n===">"?(n=">=",l?(o=Number(o)+1,s=0,i=0):(s=Number(s)+1,i=0)):n==="<="&&(n="<",l?o=Number(o)+1:s=Number(s)+1),n==="<"&&(a="-0"),`${n+o}.${s}.${i}${a}`):l?`>=${o}.0.0${a} <${Number(o)+1}.0.0-0`:f?`>=${o}.${s}.0${a} <${o}.${Number(s)+1}.0-0`:r})).join(" ")}function Ar(e){return e.trim().replace(C(pr),"")}function vr(e){return e.trim().replace(C(br),"")}function de(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Pr(e,t){const{preRelease:r}=e,{preRelease:n}=t;if(r===void 0&&n)return 1;if(r&&n===void 0)return-1;if(r===void 0&&n===void 0)return 0;for(let o=0,s=r.length;o<=s;o++){const i=r[o],a=n[o];if(i!==a)return i===void 0&&a===void 0?0:i?a?de(i,a):-1:1}return 0}function ie(e,t){return de(e.major,t.major)||de(e.minor,t.minor)||de(e.patch,t.patch)||Pr(e,t)}function Re(e,t){return e.version===t.version}function kr(e,t){switch(e.operator){case"":case"=":return Re(e,t);case">":return ie(e,t)<0;case">=":return Re(e,t)||ie(e,t)<0;case"<":return ie(e,t)>0;case"<=":return Re(e,t)||ie(e,t)>0;case void 0:return!0;default:return!1}}function Or(e){return dt(Ir,Nr,Tr,Ar)(e)}function Lr(e){return dt(Rr,Sr,$r,wr)(e.trim()).split(/\s+/).join(" ")}function Y(e,t){if(!e)return!1;const r=We(e);if(!r)return!1;const[,n,,o,s,i,a]=r,c={operator:n,version:je(o,s,i,a),major:o,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},l=t.split("||");for(const f of l){const d=f.trim();if(!d||d==="*"||d==="x")return!0;try{const u=Lr(d);if(!u.trim())return!0;const h=u.split(" ").map(E=>Or(E)).join(" ");if(!h.trim())return!0;const p=h.split(/\s+/).map(E=>vr(E)).filter(Boolean);if(p.length===0)continue;let y=!0;for(const E of p){const m=We(E);if(!m){y=!1;break}const[,g,,b,w,_,S]=m;if(!kr({operator:g,version:je(b,w,_,S),major:b,minor:w,patch:_,preRelease:S==null?void 0:S.split(".")},c)){y=!1;break}}if(y)return!0}catch(u){console.error(`[semver] Error processing range part "${d}":`,u);continue}}return!1}const ne="default",pt="global";function Mr(e,t,r,n){var s,i;let o;if("get"in e?o=e.get:"lib"in e?o=()=>Promise.resolve(e.lib):o=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)}),(s=e.shareConfig)!=null&&s.eager&&((i=e.treeShaking)!=null&&i.mode))throw new Error('Can not set "eager:true" and "treeShaking" at the same time!');return{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:o,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??n)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??$e.UNKNOWN,useIn:[]}:void 0}}function mt(e,t){const r=t.shared||{},n=t.name,o=Object.keys(r).reduce((i,a)=>{const c=it(r[a]);return i[a]=i[a]||[],c.forEach(l=>{i[a].push(Mr(l,n,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(o).forEach(i=>{s[i]?o[i].forEach(a=>{s[i].find(c=>c.version===a.version)||s[i].push(a)}):s[i]=o[i]}),{allShareInfos:s,newShareInfos:o}}function te(e,t){if(!e)return!1;const{status:r,mode:n}=e;return r===$e.NO_USE?!1:r===$e.CALCULATED?!0:n==="runtime-infer"?t?Dr(e,t):!0:!1}function U(e,t){const r=n=>{if(!Number.isNaN(Number(n))){const o=n.split(".");let s=n;for(let i=0;i<3-o.length;i++)s+=".0";return s}return n};return!!Y(r(e),`<=${r(t)}`)}const re=(e,t)=>{const r=t||function(n,o){return U(n,o)};return Object.keys(e).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},me=e=>!!e.loaded||typeof e.lib=="function",Cr=e=>!!e.loading,Dr=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(n=>r.includes(n)):!1};function Fr(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(c,l){return i?o[c].treeShaking?o[l].treeShaking?!me(o[c].treeShaking)&&U(c,l):!1:!0:!me(o[c])&&U(c,l)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}const x=e=>me(e)||Cr(e);function Hr(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(c,l){if(i){if(!o[c].treeShaking)return!0;if(!o[l].treeShaking)return!1;if(x(o[l].treeShaking))return x(o[c].treeShaking)?!!U(c,l):!0;if(x(o[c].treeShaking))return!1}return x(o[l])?x(o[c])?!!U(c,l):!0:x(o[c])?!1:U(c,l)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}function Gr(e){return e==="loaded-first"?Hr:Fr}function pe(e,t,r,n){if(!e)return;const{shareConfig:o,scope:s=ne,strategy:i,treeShaking:a}=r,c=Array.isArray(s)?s:[s];for(const l of c)if(o&&e[l]&&e[l][t]){const{requiredVersion:f}=o,{version:d,useTreesShaking:u}=Gr(i)(e,l,t,a),h=()=>{const y=e[l][t][d];if(o.singleton){if(typeof f=="string"&&!Y(d,f)){const E=`Version ${d} from ${d&&y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;o.strictVersion?O(E):Oe(E)}return{shared:y,useTreesShaking:u}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:u};if(Y(d,f))return{shared:y,useTreesShaking:u};const E=te(a);if(E){for(const[m,g]of Object.entries(e[l][t]))if(te(g.treeShaking,a==null?void 0:a.usedExports)&&Y(m,f))return{shared:g,useTreesShaking:E}}for(const[m,g]of Object.entries(e[l][t]))if(Y(m,f))return{shared:g,useTreesShaking:!1}}},p={shareScopeMap:e,scope:l,pkgName:t,version:d,GlobalFederation:ee.__FEDERATION__,shareInfo:r,resolver:h};return(n.emit(p)||p).resolver()}}function yt(){return ee.__FEDERATION__.__SHARE__}function qe(e){const{pkgName:t,extraOptions:r,shareInfos:n}=e,o=c=>{if(!c)return;const l={};return c.forEach(d=>{l[d.version]=d}),l[re(l,function(d,u){return!me(l[d])&&U(d,u)})]},s=(r==null?void 0:r.resolver)??o,i=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),a=(...c)=>{const l={};for(const f of c)if(f)for(const[d,u]of Object.entries(f)){const h=l[d];i(h)&&i(u)?l[d]=a(h,u):u!==void 0&&(l[d]=u)}return l};return a(s(n[t]),r==null?void 0:r.customShareInfo)}const B=(e,t)=>{e.useIn||(e.useIn=[]),Zt(e.useIn,t)};function ae(e,t){return t&&e.treeShaking?e.treeShaking:e}function Ur(e,t){for(const r of e){const n=t.startsWith(r.name);let o=t.replace(r.name,"");if(n){if(o.startsWith("/")){const a=r.name;return o=`.${o}`,{pkgNameOrAlias:a,expose:o,remote:r}}else if(o==="")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 xr(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const Et="RUNTIME-001",gt="RUNTIME-002",_t="RUNTIME-003",bt="RUNTIME-004",Rt="RUNTIME-005",Ae="RUNTIME-006",St="RUNTIME-007",He="RUNTIME-008",Br="RUNTIME-009",$t="RUNTIME-010",Vr=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,F=(e,t,r,n)=>{const o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(Vr(e)),n&&o.push(`Original Error Message:
|
|
4
|
+
`)}`:void 0}catch{return}}var tt=class{constructor(e,t=X){this.prefix=e,this.delegate=t??X}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??X}emit(e,t){const r=this.delegate,n=we()?Jt():void 0,o=n?[...t,n]: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,...o);return}}for(const i of s){const a=X[i];if(typeof a=="function"){a.call(X,this.prefix,...o);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){we()&&this.emit("debug",e)}};function rt(e){return new tt(e)}function Xt(e){const t=new tt(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Xt(Kt);async function nt(e,t){try{return await e()}catch(r){Ze(r);return}}function Ie(e,t){const r=/^(https?:)?\/\//i;return e.replace(r,"").replace(/\/$/,"")===t.replace(r,"").replace(/\/$/,"")}function ot(e){let t=null,r=!0,n=2e4,o;const s=document.getElementsByTagName("script");for(let c=0;c<s.length;c++){const f=s[c],h=f.getAttribute("src");if(h&&Ie(h,e.url)){t=f,r=!1;break}}if(!t){const c=e.attrs;t=document.createElement("script"),t.type=(c==null?void 0:c.type)==="module"?"module":"text/javascript";let f;e.createScriptHook&&(f=e.createScriptHook(e.url,e.attrs),f instanceof HTMLScriptElement?t=f:typeof f=="object"&&("script"in f&&f.script&&(t=f.script),"timeout"in f&&f.timeout&&(n=f.timeout))),t.src||(t.src=e.url),c&&!f&&Object.keys(c).forEach(h=>{t&&(h==="async"||h==="defer"?t[h]=c[h]:t.getAttribute(h)||t.setAttribute(h,c[h]))})}let i=null;const a=typeof window<"u"?c=>{if(c.filename&&Ie(c.filename,e.url)){const f=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);f.name="ScriptExecutionError",i=f}}:null;a&&window.addEventListener("error",a);const l=async(c,f)=>{clearTimeout(o),a&&window.removeEventListener("error",a);const h=()=>{if((f==null?void 0:f.type)==="error"){const u=new Error(`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);u.name="ScriptNetworkError",e!=null&&e.onErrorCallback&&(e==null||e.onErrorCallback(u))}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,nt(()=>{const{needDeleteScript:u=!0}=e;u&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),c&&typeof c=="function")){const u=c(f);if(u instanceof Promise){const d=await u;return h(),d}return h(),u}h()};return t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),o=setTimeout(()=>{l(null,new Error(`Remote script "${e.url}" time-outed.`))},n),{script:t,needAttach:r}}function Ee(e){let t=null,r=!0;const n=document.getElementsByTagName("link");for(let s=0;s<n.length;s++){const i=n[s],a=i.getAttribute("href"),l=i.getAttribute("rel");if(a&&Ie(a,e.url)&&l===e.attrs.rel){t=i,r=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let s;const i=e.attrs;e.createLinkHook&&(s=e.createLinkHook(e.url,i),s instanceof HTMLLinkElement&&(t=s)),i&&!s&&Object.keys(i).forEach(a=>{t&&!t.getAttribute(a)&&t.setAttribute(a,i[a])})}const o=(s,i)=>{const a=()=>{(i==null?void 0:i.type)==="error"?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,nt(()=>{const{needDeleteLink:l=!0}=e;l&&t!=null&&t.parentNode&&t.parentNode.removeChild(t)}),s)){const l=s(i);return a(),l}a()};return t.onerror=o.bind(null,t.onerror),t.onload=o.bind(null,t.onload),{link:t,needAttach:r}}function Yt(e,t){const{attrs:r={},createScriptHook:n}=t;return new Promise((o,s)=>{const{script:i,needAttach:a}=ot({url:e,cb:o,onErrorCallback:s,attrs:{fetchpriority:"high",...r},createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(i)})}const se=new Map;function B(e){if(!e)throw new Error("import specifier is required");if(se.has(e))return se.get(e);const t=new Function("name","return import(name)")(e).then(r=>r).catch(r=>{throw console.error(`Error importing module ${e}:`,r),se.delete(e),r});return se.set(e,t),t}const st=async()=>{const e=await B("node-fetch");return e.default||e},Zt=async(e,t,r)=>{const o=await((s,i)=>r.lifecycle.fetch.emit(s,i))(e,t||{});return!o||!(o instanceof Response)?(typeof fetch>"u"?await st():fetch)(e,t||{}):o},Qt=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,r,n)=>{if(n!=null&&n.createScriptHook){const a=n.createScriptHook(e);a&&typeof a=="object"&&"url"in a&&(e=a.url)}let o;try{o=new URL(e)}catch(a){console.error("Error constructing URL:",a),t(new Error(`Invalid URL: ${a}`));return}const s=async()=>n!=null&&n.fetch?(a,l)=>Zt(a,l,n):typeof fetch>"u"?st():fetch,i=async(a,l)=>{var c;try{const h=await(await a(l.href)).text(),[u,d]=await Promise.all([B("path"),B("vm")]),m={exports:{},module:{exports:{}}},y=l.pathname.split("/").slice(0,-1).join("/"),g=u.basename(l.pathname),p=new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
|
|
5
|
+
})`,{filename:g,importModuleDynamically:((c=d.constants)==null?void 0:c.USE_MAIN_CONTEXT_DEFAULT_LOADER)??B});let E;E=(await B("node:module")).createRequire(l.protocol==="file:"||l.protocol==="node:"?l.href:u.join(process.cwd(),"__mf_require_base__.js")),p.runInThisContext()(m.exports,m.module,E,y,g);const b=m.module.exports||m.exports;if(r&&b&&r.globalName){t(void 0,b[r.globalName]||b);return}t(void 0,b)}catch(f){t(f instanceof Error?f:new Error(`Script execution error: ${f}`))}};s().then(async a=>{if((r==null?void 0:r.type)==="esm"||(r==null?void 0:r.type)==="module")return Te(o.href,{fetch:a,vm:await B("vm")}).then(async l=>{await l.evaluate(),t(void 0,l.namespace)}).catch(l=>{t(l instanceof Error?l:new Error(`Script execution error: ${l}`))});i(a,o)}).catch(a=>{t(a)})}:(e,t,r,n)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},er=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((r,n)=>{Qt(e,(o,s)=>{var i,a;if(o)n(o);else{const l=((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[l]=s)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},_e=new Map;async function Te(e,t){if(_e.has(e))return _e.get(e);const{fetch:r,vm:n}=t,o=await(await r(e)).text(),s=new n.SourceTextModule(o,{importModuleDynamically:async(i,a)=>{const l=new URL(i,e).href;return Te(l,t)}});return _e.set(e,s),await s.link(async i=>{const a=new URL(i,e).href;return await Te(a,t)}),s}const D=rt("[ Module Federation Bridge Vue3 ]"),tr=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,it=(e,t,r,n)=>{const o=[`${[t[e]]} #${e}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(tr(e)),n&&o.push(`Original Error Message:
|
|
6
6
|
${n}`),o.join(`
|
|
7
|
-
`)},M={[Et]:"Failed to get remoteEntry exports.",[gt]:'The remote entry interface does not contain "init"',[_t]:"Failed to get manifest.",[bt]:"Failed to locate remote.",[Rt]:"Invalid loadShareSync function call from bundler runtime",[Ae]:"Invalid loadShareSync function call from runtime",[St]:"Failed to get remote snapshot.",[He]:"Failed to load script resources.",[Br]:"Please call createInstance first.",[$t]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.'};({...M});const wt=".then(callbacks[0]).catch(callbacks[1])";async function Wr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${wt}`)([r,n]):import(e).then(r).catch(n)}catch(o){n(o)}})}async function jr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(n):new Function("callbacks",`System.import("${e}")${wt}`)([r,n])}catch(o){n(o)}})}function It(e,t,r){const{remoteEntryKey:n,entryExports:o}=Ce(e,t);return T(o,F(Et,M,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n})),o}async function qr({name:e,globalName:t,entry:r,loaderHook:n,getEntryUrl:o}){const{entryExports:s}=Ce(e,t);return s||zt(o?o(r):r,{attrs:{},createScriptHook:(i,a)=>{const c=n.lifecycle.createScript.emit({url:i,attrs:a});if(c&&(c instanceof HTMLScriptElement||"script"in c||"timeout"in c))return c}}).then(()=>It(e,t,r)).catch(i=>{throw T(void 0,F(He,M,{remoteName:e,resourceUrl:r})),i})}async function Kr({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:n}){const{entry:o,entryGlobalName:s,name:i,type:a}=e;switch(a){case"esm":case"module":return Wr({entry:o,remoteEntryExports:t});case"system":return jr({entry:o,remoteEntryExports:t});default:return qr({entry:o,globalName:s,name:i,loaderHook:r,getEntryUrl:n})}}async function zr({remoteInfo:e,loaderHook:t}){const{entry:r,entryGlobalName:n,name:o,type:s}=e,{entryExports:i}=Ce(o,n);return i||Yt(r,{attrs:{name:o,globalName:n,type:s},loaderHook:{createScriptHook:(a,c={})=>{const l=t.lifecycle.createScript.emit({url:a,attrs:c});if(l&&"url"in l)return l}}}).then(()=>It(o,n,r)).catch(a=>{throw a})}function ve(e){const{entry:t,name:r}=e;return Je(r,t)}async function ye(e){const{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:o,_inErrorHandling:s=!1}=e,i=ve(n);if(r)return r;if(!W[i]){const a=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;W[i]=a.emit({loaderHook:c,remoteInfo:n,remoteEntryExports:r}).then(l=>l||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":H())?Kr({remoteInfo:n,remoteEntryExports:r,loaderHook:c,getEntryUrl:o}):zr({remoteInfo:n,loaderHook:c}))).catch(async l=>{const f=ve(n);if(l instanceof Error&&l.message.includes(He)&&!s){const d=h=>ye({...h,_inErrorHandling:!0}),u=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:d,origin:t,remoteInfo:n,remoteEntryExports:r,globalLoading:W,uniqueKey:f});if(u)return u}throw l})}return W[i]}function Pe(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||pt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||ne}}function Jr(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Xr(e,t){const r=sr(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(o=>{e!=null&&e.find(s=>s.name!==o.name)&&e.push(o)}),e&&e.length>0&&e.forEach(o=>{n.forEach(s=>{s.applyPlugin(o,t)})}),e}function Nt(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...e}}function Yr(e,t){return t.map(r=>{const n=xr(e,r.nameOrAlias);return T(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&Ye({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Nt(r)}})}function Zr(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Tt(e,t,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:i}=r;if(t.options.inBrowser){if(i.forEach(a=>{const{moduleInfo:c}=a,l=t.moduleCache.get(e.name);ye(l?{origin:t,remoteInfo:c,remoteEntryExports:l.remoteEntryExports}:{origin:t,remoteInfo:c,remoteEntryExports:void 0})}),n){const a={rel:"preload",as:"style"};o.forEach(c=>{const{link:l,needAttach:f}=ge({url:c,cb:()=>{},attrs:a,createLinkHook:(d,u)=>{const h=t.loaderHook.lifecycle.createLink.emit({url:d,attrs:u});if(h instanceof HTMLLinkElement)return h}});f&&document.head.appendChild(l)})}else{const a={rel:"stylesheet",type:"text/css"};o.forEach(c=>{const{link:l,needAttach:f}=ge({url:c,cb:()=>{},attrs:a,createLinkHook:(d,u)=>{const h=t.loaderHook.lifecycle.createLink.emit({url:d,attrs:u});if(h instanceof HTMLLinkElement)return h},needDeleteLink:!1});f&&document.head.appendChild(l)})}if(n){const a={rel:"preload",as:"script"};s.forEach(c=>{const{link:l,needAttach:f}=ge({url:c,cb:()=>{},attrs:a,createLinkHook:(d,u)=>{const h=t.loaderHook.lifecycle.createLink.emit({url:d,attrs:u});if(h instanceof HTMLLinkElement)return h}});f&&document.head.appendChild(l)})}else{const a={fetchpriority:"high",type:(e==null?void 0:e.type)==="module"?"module":"text/javascript"};s.forEach(c=>{const{script:l,needAttach:f}=nt({url:c,cb:()=>{},attrs:a,createScriptHook:(d,u)=>{const h=t.loaderHook.lifecycle.createScript.emit({url:d,attrs:u});if(h instanceof HTMLScriptElement)return h},needDeleteScript:!0});f&&document.head.appendChild(l)})}}}function Qr(e,t,r){const n=t,o=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];o.length||o.push("default"),o.forEach(i=>{n[i]||(n[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?o:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:n,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:n[o[0]],initScope:r??[]}}var At=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await ye({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return T(e,`remoteEntryExports is undefined
|
|
8
|
-
${Ye(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,t,r){const n=await this.getEntry();if(this.inited)return n;if(this.initPromise)return await this.initPromise,n;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:o,shareScope:s,initScope:i}=Qr(this.remoteInfo,this.host.shareScopeMap,r),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:o,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&O(F(gt,M,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,r,n){const{loadFactory:o=!0}=r||{loadFactory:!0},s=await this.init(e,n);this.lib=s;let i;i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo}),i||(i=await s.get(t)),T(i,`${Q(this.remoteInfo)} remote don't export ${t}.`);const a=tr(this.remoteInfo.name,t),c=this.wraperFactory(i,a);return o?await c():c}wraperFactory(e,t){function r(n,o){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:o,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return r(n,t),n}:()=>{const n=e();return r(n,t),n}}},v=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(...n){return t.remove(r),e.apply(null,n)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{t=r(...e)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},P=class extends v{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>s===!1?!1:n<r.length?Promise.resolve(r[n++].apply(null,e)).then(o):s;t=o()}return Promise.resolve(t)}};function vt(e,t){if(!Me(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var q=class extends v{constructor(e){super(),this.onerror=O,this.type=e}emit(e){Me(e)||O(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(vt(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){Oe(r),this.onerror(r)}return e}},G=class extends v{constructor(e){super(),this.onerror=O,this.type=e}emit(e){Me(e)||O(`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 n=s=>(Oe(s),this.onerror(s),e),o=s=>{if(vt(e,s)){if(e=s,r<t.length)try{return Promise.resolve(t[r++](e)).then(o,n)}catch(i){return n(i)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(o(e))}return Promise.resolve(e)}},K=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var n;T(er(e),"Plugin configuration is invalid.");const r=e.name;T(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,(n=e.apply)==null||n.call(e,t),Object.keys(this.lifecycle).forEach(o=>{const s=e[o];s&&this.lifecycle[o].on(s)}))}removePlugin(e){T(e,"A name is required.");const t=this.registerPlugins[e];T(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(r=>{r!=="name"&&this.lifecycle[r].remove(t[r])})}};function Pt(e,t){const r=at(t);r.url||O(`The attribute remoteEntry of ${e.name} must not be undefined.`);let n=Ie(t,r.url);!H()&&!n.startsWith("http")&&(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function en(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:s,id:i}=e;if(!Le(t)||!st(t)){const{remoteSnapshot:a,globalSnapshot:c}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:i});Pt(s,a);const l={remote:t,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},f=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:l,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:c});return f&&Tt(s,o,f,!1),{...e,remoteSnapshot:a}}return e}}}function tn(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 kt(e,t,r,n,o={},s){const{value:i}=z(e,Q(t)),a=s||i;if(a&&!Ze(a)&&(r(a,t,n),a.remotesInfo)){const c=Object.keys(a.remotesInfo);for(const l of c){if(o[l])continue;o[l]=!0;const f=tn(l),d=a.remotesInfo[l];kt(e,{name:f.name,version:d.matchedVersion},r,!1,o,void 0)}}}const Se=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function rn(e,t,r,n,o){const s=[],i=[],a=[],c=new Set,l=new Set,{options:f}=e,{preloadConfig:d}=t,{depsRemote:u}=d;if(kt(n,r,(p,y,E)=>{var S;let m;if(E)m=d;else if(Array.isArray(u)){const R=u.find($=>$.nameOrAlias===y.name||$.nameOrAlias===y.alias);if(!R)return;m=Nt(R)}else if(u===!0)m=d;else return;const g=Ie(p,at(p).url);g&&a.push({name:y.name,moduleInfo:{name:y.name,entry:g,type:"remoteEntryType"in p?p.remoteEntryType:"global",entryGlobalName:"globalName"in p?p.globalName:y.name,shareScope:"",version:"version"in p?p.version:void 0},url:g});let b="modules"in p?p.modules:[];const w=Zr(m.exposes);w.length&&"modules"in p&&(b=(S=p==null?void 0:p.modules)==null?void 0:S.reduce((R,$)=>((w==null?void 0:w.indexOf($.moduleName))!==-1&&R.push($),R),[]));function _(R){const $=R.map(L=>Ie(p,L));return m.filter?$.filter(m.filter):$}if(b){const R=b.length;for(let $=0;$<R;$++){const L=b[$],Ee=`${y.name}/${L.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:L.moduleName==="."?y.name:Ee,name:y.name,remoteSnapshot:p,preloadConfig:m,remote:y,origin:e}),!ir(Ee)&&(m.resourceCategory==="all"?(s.push(..._(L.assets.css.async)),s.push(..._(L.assets.css.sync)),i.push(..._(L.assets.js.async)),i.push(..._(L.assets.js.sync))):(m.resourceCategory="sync")&&(s.push(..._(L.assets.css.sync)),i.push(..._(L.assets.js.sync))),ar(Ee))}}},!0,{},o),o.shared&&o.shared.length>0){const p=(y,E)=>{const{shared:m}=pe(e.shareScopeMap,E.sharedName,y,e.sharedHandler.hooks.lifecycle.resolveShare)||{};m&&typeof m.lib=="function"&&(E.assets.js.sync.forEach(g=>{c.add(g)}),E.assets.css.sync.forEach(g=>{l.add(g)}))};o.shared.forEach(y=>{var g;const E=(g=f.shared)==null?void 0:g[y.sharedName];if(!E)return;const m=y.version?E.find(b=>b.version===y.version):E;m&&it(m).forEach(b=>{p(b,y)})})}const h=i.filter(p=>!c.has(p)&&!Se("script",p));return{cssAssets:s.filter(p=>!l.has(p)&&!Se("link",p)),jsAssetsWithoutEntry:h,entryAssets:a.filter(p=>!Se("script",p.url))}}const nn=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:s,remoteSnapshot:i}=e;return H()?Le(o)&&st(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(Pt(n,i),rn(t,r,n,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Ot(e,t){const r=fe({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&z(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:Ge(),remoteSnapshot:fe({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Ge(),remoteSnapshot:fe({name:e.name,version:"version"in e?e.version:void 0})}}var on=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new K({beforeLoadRemoteSnapshot:new P("beforeLoadRemoteSnapshot"),loadSnapshot:new G("loadGlobalSnapshot"),loadRemoteSnapshot:new G("loadRemoteSnapshot"),afterLoadSnapshot:new G("afterLoadSnapshot")}),this.manifestLoading=ee.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,expose:r}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let o=fe({name:this.HostInstance.options.name,version:this.HostInstance.options.version});o||(o={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},or({[this.HostInstance.options.name]:o})),o&&"remotesInfo"in o&&!z(o.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(o.remotesInfo={...o==null?void 0:o.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:n,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let f,d;if(c)if(Ze(c)){const u=H()?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",h=await this.getManifestJson(u,e,{}),p=Ue({...e,entry:u},h);f=h,d=p}else{const{remoteSnapshot:u}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});f=u,d=l}else if(Le(e)){const u=await this.getManifestJson(e.entry,e,{}),h=Ue(e,u),{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:u,from:"global"});f=p,d=h}else O(F(St,M,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(l)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:f}),{remoteSnapshot:f,globalSnapshot:d}}getGlobalRemoteInfo(e){return Ot(e,this.HostInstance)}async getManifestJson(e,t,r){const n=async()=>{let s=this.manifestCache.get(e);if(s)return s;try{let i=await this.loaderHook.lifecycle.fetch.emit(e,{});(!i||!(i instanceof Response))&&(i=await fetch(e,{})),s=await i.json()}catch(i){s=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),s||(delete this.manifestLoading[e],O(F(_t,M,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${i}`)))}return T(s.metaData&&s.exposes&&s.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,s),s},o=async()=>{const s=await n(),i=Vt(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]=o().then(s=>s)),this.manifestLoading[e]}},sn=class{constructor(e){this.hooks=new K({beforeRegisterShare:new q("beforeRegisterShare"),afterResolve:new G("afterResolve"),beforeLoadShare:new G("beforeLoadShare"),loadShare:new P,resolveShare:new q("resolveShare"),initContainerShareScopeMap:new q("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,t){const{newShareInfos:r,allShareInfos:n}=mt(e,t);return Object.keys(r).forEach(o=>{r[o].forEach(s=>{s.scope.forEach(i=>{var a;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:o,shared:s}),(a=this.shareScopeMap[i])!=null&&a[o]||this.setShared({pkgName:o,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name})})})}),{newShareInfos:r,allShareInfos:n}}async loadShare(e,t){const{host:r}=this,n=qe({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async a=>{await Promise.all(this.initializeSharing(a,{strategy:n.strategy}))}));const{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});T(o,`Cannot find ${e} Share in the ${r.options.name}. Please ensure that the ${e} Share parameters have been injected`);const{shared:s,useTreesShaking:i}=pe(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(s){const a=ae(s,i);if(a.lib)return B(a,r.options.name),a.lib;if(a.loading&&!a.loaded){const c=await a.loading;return a.loaded=!0,a.lib||(a.lib=c),B(a,r.options.name),c}else{const l=(async()=>{const f=await a.get();return B(a,r.options.name),a.loaded=!0,a.lib=f,f})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:r.options.name,lib:null,loading:l,treeShaking:i?a:void 0}),l}}else{if(t!=null&&t.customShareInfo)return!1;const a=te(o.treeShaking),c=ae(o,a),f=(async()=>{const d=await c.get();c.lib=d,c.loaded=!0,B(c,r.options.name);const{shared:u,useTreesShaking:h}=pe(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(u){const p=ae(u,h);p.lib=d,p.loaded=!0,u.from=o.from}return d})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:f,treeShaking:a?c:void 0}),f}}initializeSharing(e=ne,t){const{host:r}=this,n=t==null?void 0:t.from,o=t==null?void 0:t.strategy;let s=t==null?void 0:t.initScope;const i=[];if(n!=="build"){const{initTokens:u}=this;s||(s=[]);let h=u[e];if(h||(h=u[e]={from:this.host.name}),s.indexOf(h)>=0)return i;s.push(h)}const a=this.shareScopeMap,c=r.options.name;a[e]||(a[e]={});const l=a[e],f=(u,h)=>{var b;const{version:p,eager:y}=h;l[u]=l[u]||{};const E=l[u],m=E[p]&&ae(E[p]),g=!!(m&&("eager"in m&&m.eager||"shareConfig"in m&&((b=m.shareConfig)!=null&&b.eager)));(!m||m.strategy!=="loaded-first"&&!m.loaded&&(!y!=!g?y:c>E[p].from))&&(E[p]=h)},d=async u=>{const{module:h}=await r.remoteHandler.getRemoteModuleAndOptions({id:u});let p;try{p=await h.getEntry()}catch(y){p=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:u,error:y,from:"runtime",lifecycle:"beforeLoadShare",origin:r})}finally{p!=null&&p.init&&!h.initing&&(h.remoteEntryExports=p,await h.init(void 0,void 0,s))}};return Object.keys(r.options.shared).forEach(u=>{r.options.shared[u].forEach(h=>{h.scope.includes(e)&&f(u,h)})}),(r.options.shareStrategy==="version-first"||o==="version-first")&&r.options.remotes.forEach(u=>{u.shareScope===e&&i.push(d(u.name))}),i}loadShareSync(e,t){const{host:r}=this,n=qe({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy})});const{shared:o,useTreesShaking:s}=pe(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(o){if(typeof o.lib=="function")return B(o,r.options.name),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if(typeof o.get=="function"){const i=o.get();if(!(i instanceof Promise))return B(o,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const i=n.get();if(i instanceof Promise){const a=(t==null?void 0:t.from)==="build"?Rt:Ae;throw new Error(F(a,M,{hostName:r.options.name,sharedPkgName:e}))}return n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}throw new Error(F(Ae,M,{hostName:r.options.name,sharedPkgName:e}))}initShareScopeMap(e,t,r={}){const{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:n,loading:o,loaded:s,get:i,treeShaking:a}){const{version:c,scope:l="default",...f}=t,d=Array.isArray(l)?l:[l],u=h=>{const p=(E,m,g)=>{g&&!E[m]&&(E[m]=g)},y=a?h.treeShaking:h;p(y,"loaded",s),p(y,"loading",o),p(y,"get",i)};d.forEach(h=>{this.shareScopeMap[h]||(this.shareScopeMap[h]={}),this.shareScopeMap[h][e]||(this.shareScopeMap[h][e]={}),this.shareScopeMap[h][e][c]||(this.shareScopeMap[h][e][c]={version:c,scope:[h],...f,lib:n});const p=this.shareScopeMap[h][e][c];u(p),r&&p.from!==r&&(p.from=r)})}_setGlobalShareScopeMap(e){const t=yt(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},an=class{constructor(e){this.hooks=new K({beforeRegisterRemote:new q("beforeRegisterRemote"),registerRemote:new q("registerRemote"),beforeRequest:new G("beforeRequest"),onLoad:new P("onLoad"),handlePreloadModule:new v("handlePreloadModule"),errorLoadRemote:new P("errorLoadRemote"),beforePreloadRemote:new P("beforePreloadRemote"),generatePreloadAssets:new P("generatePreloadAssets"),afterPreloadRemote:new P,loadEntry:new P}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,n)=>(this.registerRemote(n,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:n}=t,{name:o,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},s&&e.startsWith(o)){const i=e.replace(o,s);this.idToRemoteMap[i]={name:r.name,expose:n};return}if(s&&e.startsWith(s)){const i=e.replace(s,o);this.idToRemoteMap[i]={name:r.name,expose:n}}}async loadRemote(e,t){const{host:r}=this;try{const{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:s,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:a,remote:c,expose:l,id:f,remoteSnapshot:d}=i,u=await o.get(f,l,t,d),h=await this.hooks.lifecycle.onLoad.emit({id:f,pkgNameOrAlias:a,expose:l,exposeModule:n?u:void 0,exposeModuleFactory:n?void 0:u,remote:c,options:s,moduleInstance:o,origin:r});return this.setIdToRemoteMap(e,i),typeof h=="function"?h:u}catch(n){const{from:o="runtime"}=t||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:o,lifecycle:"onLoad",origin:r});if(!s)throw n;return s}}async preloadRemote(e){const{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=Yr(t.options.remotes,e);await Promise.all(r.map(async n=>{const{remote:o}=n,s=Pe(o),{globalSnapshot:i,remoteSnapshot:a}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o}),c=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:n,remote:o,remoteInfo:s,globalSnapshot:i,remoteSnapshot:a});c&&Tt(s,t,c)}))}registerRemotes(e,t){const{host:r}=this;e.forEach(n=>{this.registerRemote(n,r.options.remotes,{force:t==null?void 0:t.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(h){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:h,lifecycle:"beforeRequest"}),!n)throw h}const{id:o}=n,s=Ur(t.options.remotes,o);T(s,F(bt,M,{hostName:t.options.name,requestId:o}));const{remote:i}=s,a=Pe(i),c=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:o,...s,options:t.options,origin:t,remoteInfo:a}),{remote:l,expose:f}=c;T(l&&f,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);let d=t.moduleCache.get(l.name);const u={host:t,remoteInfo:a};return d||(d=new At(u),t.moduleCache.set(l.name,d)),{module:d,moduleOptions:u,remoteMatchInfo:c}}registerRemote(e,t,r){const{host:n}=this,o=()=>{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)))});T(!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&&H()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=ne),e.type||(e.type=pt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const s=t.find(i=>i.name===e.name);if(!s)o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});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),o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),Xe(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(i=>i.name===n);o!==-1&&r.options.remotes.splice(o,1);const s=r.moduleCache.get(e.name);if(s){const i=s.remoteInfo,a=i.entryGlobalName;I[a]&&((t=Object.getOwnPropertyDescriptor(I,a))!=null&&t.configurable?delete I[a]:I[a]=void 0);const c=ve(s.remoteInfo);W[c]&&delete W[c],r.snapshotHandler.manifestCache.delete(i.entry);let l=i.buildVersion?Je(i.name,i.buildVersion):i.name;const f=I.__FEDERATION__.__INSTANCES__.findIndex(u=>i.buildVersion?u.options.id===l:u.name===l);if(f!==-1){const u=I.__FEDERATION__.__INSTANCES__[f];l=u.options.id||l;const h=yt();let p=!0;const y=[];Object.keys(h).forEach(E=>{const m=h[E];m&&Object.keys(m).forEach(g=>{const b=m[g];b&&Object.keys(b).forEach(w=>{const _=b[w];_&&Object.keys(_).forEach(S=>{const R=_[S];R&&typeof R=="object"&&R.from===i.name&&(R.loaded||R.loading?(R.useIn=R.useIn.filter($=>$!==i.name),R.useIn.length?p=!1:y.push([E,g,w,S])):y.push([E,g,w,S]))})})})}),p&&(u.shareScopeMap={},delete h[l]),y.forEach(([E,m,g,b])=>{var w,_,S;(S=(_=(w=h[E])==null?void 0:w[m])==null?void 0:_[g])==null||delete S[b]}),I.__FEDERATION__.__INSTANCES__.splice(f,1)}const{hostGlobalSnapshot:d}=Ot(e,r);if(d){const u=d&&"remotesInfo"in d&&d.remotesInfo&&z(d.remotesInfo,e.name).key;u&&(delete d.remotesInfo[u],ee.__FEDERATION__.__MANIFEST_LOADING__[u]&&delete ee.__FEDERATION__.__MANIFEST_LOADING__[u])}r.moduleCache.delete(e.name)}}catch(r){Te.log("removeRemote fail: ",r)}}};const cn=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;var ln=class{constructor(e){this.hooks=new K({beforeInit:new q("beforeInit"),init:new v,beforeInitContainer:new G("beforeInitContainer"),initContainer:new G("initContainer")}),this.version="2.1.0",this.moduleCache=new Map,this.loaderHook=new K({getModuleInfo:new v,createScript:new v,createLink:new v,fetch:new P,loadEntryError:new P,getModuleFactory:new P}),this.bridgeHook=new K({beforeBridgeRender:new v,afterBridgeRender:new v,beforeBridgeDestroy:new v,afterBridgeDestroy:new v});const t=cn?[en(),nn()]:[],r={id:Jr(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:H()};this.name=e.name,this.options=r,this.snapshotHandler=new on(this),this.sharedHandler=new sn(this),this.remoteHandler=new an(this),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&&O(F($t,M)),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=ne,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){const n=Pe({name:e,entry:t}),o=new At({host:this,remoteInfo:n});return o.remoteEntryExports=r,this.moduleCache.set(e,o),o}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{allShareInfos:r}=mt(e,t),{userOptions:n,options:o}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(o,n),{allShareInfos:i}=this.sharedHandler.registerShared(o,n),a=[...o.plugins];n.plugins&&n.plugins.forEach(l=>{a.includes(l)||a.push(l)});const c={...e,...t,plugins:a,remotes:s,shared:i};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const t=Xr(e,this);this.options.plugins=this.options.plugins.reduce((r,n)=>(n&&r&&!r.find(o=>o.name===n.name)&&r.push(n),r),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let un=null;function Lt(){return un}rr(ln);function Mt(e,t){return e.map(r=>{const n={...r,path:t+r.path};return r.children&&r.children.length>0&&(n.children=Mt(r.children,t)),n})}function fn(e){const{router:t,basename:r,memoryRoute:n,hashRoute:o}=e,s=t.getRoutes().sort((u,h)=>u.path.split("/").filter(p=>p).length-h.path.split("/").filter(p=>p).length),i=new Map,a=new Set;s.forEach(u=>{i.set(u.path,u)});const c=(u,h)=>`${u}/${h}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",l=(u,h="")=>{if(!u.children||u.children.length===0)return u;for(let p=0;p<u.children.length;p++){const y=u.children[p],E=c(h,y.path),m=i.get(E);if(m&&!a.has(m)){const g={...m,path:y.path};u.children[p]=g,a.add(m),l(g,E)}}return u};let f=[];for(const u of s)if(!a.has(u)){const h=l(u,u.path);a.add(u),f.push(h)}let d;return n?d=ce.createMemoryHistory(r):o?(d=ce.createWebHashHistory(),r&&(f=Mt(f,r))):d=ce.createWebHistory(r),{history:d,routes:f}}function hn(e){const t=new Map,r=Lt();return()=>({__APP_VERSION__:"2.1.0",async render(n){var p,y,E;D.debug("createBridgeComponent render Info",n);const{moduleName:o,dom:s,basename:i,memoryRoute:a,hashRoute:c,...l}=n,f=Dt.createApp(e.rootComponent,l);t.set(s,f);const d=await((E=(y=(p=r==null?void 0:r.bridgeHook)==null?void 0:p.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:E.emit(n)),u=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,...u});if(h!=null&&h.router){const{history:m,routes:g}=fn({router:h.router,basename:n.basename,memoryRoute:n.memoryRoute,hashRoute:n.hashRoute}),b=ce.createRouter({...h.router.options,history:m,routes:g});D.debug("createBridgeComponent render router info>>>",{moduleName:o,router:b}),a&&await b.push(a.entryPath),f.use(b)}f.mount(s)},destroy(n){D.debug("createBridgeComponent destroy Info",n);const o=t.get(n==null?void 0:n.dom);o==null||o.unmount()}})}function dn(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const pn=A.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=A.ref(null),r=A.ref(null),n=A.ref(""),o=ke.useRoute(),s=Lt(),i=A.useAttrs(),a=async()=>{var u,h,p,y;const l=(u=e.providerInfo)==null?void 0:u.call(e);r.value=l;let f={...i,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",f);const d=await((y=(p=(h=s==null?void 0:s.bridgeHook)==null?void 0:h.lifecycle)==null?void 0:p.beforeBridgeRender)==null?void 0:y.emit(f))||{};f={...f,...d.extraProps},l.render(f)},c=A.watch(()=>o==null?void 0:o.path,l=>{l!==o.path&&a(),n.value!==""&&n.value!==l&&(D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:o.path}),dn()),n.value=l});return A.onMounted(()=>{a()}),A.onBeforeUnmount(()=>{var l;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e}),c(),(l=r.value)==null||l.destroy({dom:t.value})}),()=>A.createVNode("div",A.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function Ct(e){return A.defineAsyncComponent({__APP_VERSION__:"2.1.0",...e.asyncComponentOptions,loader:async()=>{var c,l;const t=ke.useRoute();let r="/";const n=(l=(c=t==null?void 0:t.matched)==null?void 0:c[0])==null?void 0:l.path;n&&(n.endsWith("/:pathMatch(.*)*")?r=n.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const o=(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[o];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:o,basename:r,route:t}),o in s&&typeof a=="function")return{render(){return A.h(pn,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs})}};throw new Error("module not found")}})}function mn(e){return D.warn("createRemoteAppComponent is deprecated, please use createRemoteAppComponent instead!"),Ct(e)}exports.createBridgeComponent=hn;exports.createRemoteAppComponent=Ct;exports.createRemoteComponent=mn;
|
|
7
|
+
`)};function rr(e,t,r,n,o,s){return n(it(e,t,r,o))}const G="[ Federation Runtime ]",ve=rt(G);function k(e,t,r,n,o){e||S(t)}function S(e,t,r,n,o){if(t!==void 0)return rr(e,t,r??{},i=>{throw new Error(`${G}: ${i}`)},n);const s=e;throw s instanceof Error?(s.message.startsWith(G)||(s.message=`${G}: ${s.message}`),s):new Error(`${G}: ${s}`)}function Le(e){e instanceof Error&&(e.message.startsWith(G)||(e.message=`${G}: ${e.message}`)),ve.warn(e)}function nr(e,t){return e.findIndex(r=>r===t)===-1&&e.push(t),e}function Q(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Me(e){return typeof e.entry<"u"}function at(e){return!e.entry.includes(".json")}function Ce(e){return e&&typeof e=="object"}const or=Object.prototype.toString;function sr(e){return or.call(e)==="[object Object]"}function ct(e){return Array.isArray(e)?e:[e]}function lt(e){const t={url:"",type:"global",globalName:""};return H||Xe()||!("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 ir=(e,t)=>{let r;return e.endsWith("/")?r=e.slice(0,-1):r=e,t.startsWith(".")&&(t=t.slice(1)),r=r+t,r},I=typeof globalThis=="object"?globalThis:window,O=(()=>{try{return document.defaultView}catch{return I}})(),ee=O;function le(e,t,r){Object.defineProperty(e,t,{value:r,configurable:!1,writable:!0})}function ue(e,t){return Object.hasOwnProperty.call(e,t)}ue(I,"__GLOBAL_LOADING_REMOTE_ENTRY__")||le(I,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const W=I.__GLOBAL_LOADING_REMOTE_ENTRY__;function ut(e){var t,r,n,o,s,i;ue(e,"__VMOK__")&&!ue(e,"__FEDERATION__")&&le(e,"__FEDERATION__",e.__VMOK__),ue(e,"__FEDERATION__")||(le(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),le(e,"__VMOK__",e.__FEDERATION__)),(t=e.__FEDERATION__).__GLOBAL_PLUGIN__??(t.__GLOBAL_PLUGIN__=[]),(r=e.__FEDERATION__).__INSTANCES__??(r.__INSTANCES__=[]),(n=e.__FEDERATION__).moduleInfo??(n.moduleInfo={}),(o=e.__FEDERATION__).__SHARE__??(o.__SHARE__={}),(s=e.__FEDERATION__).__MANIFEST_LOADING__??(s.__MANIFEST_LOADING__={}),(i=e.__FEDERATION__).__PRELOADED_MAP__??(i.__PRELOADED_MAP__=new Map)}ut(I);ut(O);function ar(e,t=we()){t&&(I.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.2.0")}function K(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const r=Object.keys(e);for(const n of r){const[o,s]=n.split(":"),i=`${o}:${t}`,a=e[i];if(a)return{value:a,key:i}}return{value:void 0,key:t}}}else S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}const xe=()=>O.__FEDERATION__.moduleInfo,cr=(e,t)=>{const r=K(t,Q(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:n,...o}=e,s=Q(o),i=K(O.__FEDERATION__.moduleInfo,s).value;if((i==null?void 0:i.version)===n)return i}},fe=e=>cr(e,O.__FEDERATION__.moduleInfo),Ue=(e,t)=>{const r=Q(e);return O.__FEDERATION__.moduleInfo[r]=t,O.__FEDERATION__.moduleInfo},lr=e=>(O.__FEDERATION__.moduleInfo={...O.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const r of t)delete O.__FEDERATION__.moduleInfo[r]}),De=(e,t)=>{const r=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:r,entryExports:I[r]}},ur=()=>O.__FEDERATION__.__GLOBAL_PLUGIN__,fr=e=>I.__FEDERATION__.__PRELOADED_MAP__.get(e),hr=e=>I.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Ve="[0-9A-Za-z-]+",Fe=`(?:\\+(${Ve}(?:\\.${Ve})*))`,Z="0|[1-9]\\d*",he="[0-9]+",ft="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Be=`(?:${he}|${ft})`,dr=`(?:-?(${Be}(?:\\.${Be})*))`,We=`(?:${Z}|${ft})`,ht=`(?:-(${We}(?:\\.${We})*))`,be=`${Z}|x|X|\\*`,z=`[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ht})?${Fe}?)?)?`,mr=`^\\s*(${z})\\s+-\\s+(${z})\\s*$`,pr=`[v=\\s]*${`(${he})\\.(${he})\\.(${he})`}${dr}?${Fe}?`,He="((?:<|>)?=?)",yr=`(\\s*)${He}\\s*(${pr}|${z})`,dt="(?:~>?)",gr=`(\\s*)${dt}\\s+`,mt="(?:\\^)",Er=`(\\s*)${mt}\\s+`,_r="(<|>)?=?\\s*\\*",br=`^${mt}${z}$`,Rr=`v?${`(${Z})\\.(${Z})\\.(${Z})`}${ht}?${Fe}?`,Sr=`^${dt}${z}$`,$r=`^${He}\\s*${z}$`,wr=`^${He}\\s*(${Rr})$|^$`,Nr="^\\s*>=\\s*0.0.0\\s*$";function C(e){return new RegExp(e)}function T(e){return!e||e.toLowerCase()==="x"||e==="*"}function pt(...e){return t=>e.reduce((r,n)=>n(r),t)}function je(e){return e.match(C(wr))}function qe(e,t,r,n){const o=`${e}.${t}.${r}`;return n?`${o}-${n}`:o}function Ir(e){return e.replace(C(mr),(t,r,n,o,s,i,a,l,c,f,h,u)=>(T(n)?r="":T(o)?r=`>=${n}.0.0`:T(s)?r=`>=${n}.${o}.0`:r=`>=${r}`,T(c)?l="":T(f)?l=`<${Number(c)+1}.0.0-0`:T(h)?l=`<${c}.${Number(f)+1}.0-0`:u?l=`<=${c}.${f}.${h}-${u}`:l=`<=${l}`,`${r} ${l}`.trim()))}function Tr(e){return e.replace(C(yr),"$1$2$3")}function vr(e){return e.replace(C(gr),"$1~")}function Ar(e){return e.replace(C(Er),"$1^")}function Pr(e){return e.trim().split(/\s+/).map(t=>t.replace(C(br),(r,n,o,s,i)=>T(n)?"":T(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T(s)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:i?n==="0"?o==="0"?`>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s}-${i} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${s} <${n}.${o}.${Number(s)+1}-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${Number(n)+1}.0.0-0`)).join(" ")}function kr(e){return e.trim().split(/\s+/).map(t=>t.replace(C(Sr),(r,n,o,s,i)=>T(n)?"":T(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:T(s)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:i?`>=${n}.${o}.${s}-${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${s} <${n}.${Number(o)+1}.0-0`)).join(" ")}function Or(e){return e.split(/\s+/).map(t=>t.trim().replace(C($r),(r,n,o,s,i,a)=>{const l=T(o),c=l||T(s),f=c||T(i);return n==="="&&f&&(n=""),a="",l?n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(s=0),i=0,n===">"?(n=">=",c?(o=Number(o)+1,s=0,i=0):(s=Number(s)+1,i=0)):n==="<="&&(n="<",c?o=Number(o)+1:s=Number(s)+1),n==="<"&&(a="-0"),`${n+o}.${s}.${i}${a}`):c?`>=${o}.0.0${a} <${Number(o)+1}.0.0-0`:f?`>=${o}.${s}.0${a} <${o}.${Number(s)+1}.0-0`:r})).join(" ")}function Lr(e){return e.trim().replace(C(_r),"")}function Mr(e){return e.trim().replace(C(Nr),"")}function de(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Cr(e,t){const{preRelease:r}=e,{preRelease:n}=t;if(r===void 0&&n)return 1;if(r&&n===void 0)return-1;if(r===void 0&&n===void 0)return 0;for(let o=0,s=r.length;o<=s;o++){const i=r[o],a=n[o];if(i!==a)return i===void 0&&a===void 0?0:i?a?de(i,a):-1:1}return 0}function ie(e,t){return de(e.major,t.major)||de(e.minor,t.minor)||de(e.patch,t.patch)||Cr(e,t)}function Re(e,t){return e.version===t.version}function Dr(e,t){switch(e.operator){case"":case"=":return Re(e,t);case">":return ie(e,t)<0;case">=":return Re(e,t)||ie(e,t)<0;case"<":return ie(e,t)>0;case"<=":return Re(e,t)||ie(e,t)>0;case void 0:return!0;default:return!1}}function Fr(e){return pt(Pr,kr,Or,Lr)(e)}function Hr(e){return pt(Ir,Tr,vr,Ar)(e.trim()).split(/\s+/).join(" ")}function Y(e,t){if(!e)return!1;const r=je(e);if(!r)return!1;const[,n,,o,s,i,a]=r,l={operator:n,version:qe(o,s,i,a),major:o,minor:s,patch:i,preRelease:a==null?void 0:a.split(".")},c=t.split("||");for(const f of c){const h=f.trim();if(!h||h==="*"||h==="x")return!0;try{const u=Hr(h);if(!u.trim())return!0;const d=u.split(" ").map(g=>Fr(g)).join(" ");if(!d.trim())return!0;const m=d.split(/\s+/).map(g=>Mr(g)).filter(Boolean);if(m.length===0)continue;let y=!0;for(const g of m){const p=je(g);if(!p){y=!1;break}const[,E,,b,N,_,$]=p;if(!Dr({operator:E,version:qe(b,N,_,$),major:b,minor:N,patch:_,preRelease:$==null?void 0:$.split(".")},l)){y=!1;break}}if(y)return!0}catch(u){console.error(`[semver] Error processing range part "${h}":`,u);continue}}return!1}const ne="default",yt="global";function Gr(e,t,r,n){var s,i;let o;return"get"in e?o=e.get:"lib"in e?o=()=>Promise.resolve(e.lib):o=()=>Promise.resolve(()=>{S(`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)&&S(`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:o,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??n)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??$e.UNKNOWN,useIn:[]}:void 0}}function gt(e,t){const r=t.shared||{},n=t.name,o=Object.keys(r).reduce((i,a)=>{const l=ct(r[a]);return i[a]=i[a]||[],l.forEach(c=>{i[a].push(Gr(c,n,a,t.shareStrategy))}),i},{}),s={...e.shared};return Object.keys(o).forEach(i=>{s[i]?o[i].forEach(a=>{s[i].find(l=>l.version===a.version)||s[i].push(a)}):s[i]=o[i]}),{allShareInfos:s,newShareInfos:o}}function te(e,t){if(!e)return!1;const{status:r,mode:n}=e;return r===$e.NO_USE?!1:r===$e.CALCULATED?!0:n==="runtime-infer"?t?Ur(e,t):!0:!1}function x(e,t){const r=n=>{if(!Number.isNaN(Number(n))){const o=n.split(".");let s=n;for(let i=0;i<3-o.length;i++)s+=".0";return s}return n};return!!Y(r(e),`<=${r(t)}`)}const re=(e,t)=>{const r=t||function(n,o){return x(n,o)};return Object.keys(e).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},pe=e=>!!e.loaded||typeof e.lib=="function",xr=e=>!!e.loading,Ur=(e,t)=>{if(!e||!t)return!1;const{usedExports:r}=e;return r?!!t.every(n=>r.includes(n)):!1};function Vr(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(l,c){return i?o[l].treeShaking?o[c].treeShaking?!pe(o[l].treeShaking)&&x(l,c):!1:!0:!pe(o[l])&&x(l,c)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}const U=e=>pe(e)||xr(e);function Br(e,t,r,n){const o=e[t][r];let s="",i=te(n);const a=function(l,c){if(i){if(!o[l].treeShaking)return!0;if(!o[c].treeShaking)return!1;if(U(o[c].treeShaking))return U(o[l].treeShaking)?!!x(l,c):!0;if(U(o[l].treeShaking))return!1}return U(o[c])?U(o[l])?!!x(l,c):!0:U(o[l])?!1:x(l,c)};if(i){if(s=re(e[t][r],a),s)return{version:s,useTreesShaking:i};i=!1}return{version:re(e[t][r],a),useTreesShaking:i}}function Wr(e){return e==="loaded-first"?Br:Vr}function me(e,t,r,n){if(!e)return;const{shareConfig:o,scope:s=ne,strategy:i,treeShaking:a}=r,l=Array.isArray(s)?s:[s];for(const c of l)if(o&&e[c]&&e[c][t]){const{requiredVersion:f}=o,{version:h,useTreesShaking:u}=Wr(i)(e,c,t,a),d=()=>{const y=e[c][t][h];if(o.singleton){if(typeof f=="string"&&!Y(h,f)){const g=`Version ${h} from ${h&&y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;o.strictVersion?S(g):Le(g)}return{shared:y,useTreesShaking:u}}else{if(f===!1||f==="*")return{shared:y,useTreesShaking:u};if(Y(h,f))return{shared:y,useTreesShaking:u};const g=te(a);if(g){for(const[p,E]of Object.entries(e[c][t]))if(te(E.treeShaking,a==null?void 0:a.usedExports)&&Y(p,f))return{shared:E,useTreesShaking:g}}for(const[p,E]of Object.entries(e[c][t]))if(Y(p,f))return{shared:E,useTreesShaking:!1}}},m={shareScopeMap:e,scope:c,pkgName:t,version:h,GlobalFederation:ee.__FEDERATION__,shareInfo:r,resolver:d};return(n.emit(m)||m).resolver()}}function Et(){return ee.__FEDERATION__.__SHARE__}function Ke(e){const{pkgName:t,extraOptions:r,shareInfos:n}=e,o=l=>{if(!l)return;const c={};return l.forEach(h=>{c[h.version]=h}),c[re(c,function(h,u){return!pe(c[h])&&x(h,u)})]},s=(r==null?void 0:r.resolver)??o,i=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),a=(...l)=>{const c={};for(const f of l)if(f)for(const[h,u]of Object.entries(f)){const d=c[h];i(d)&&i(u)?c[h]=a(d,u):u!==void 0&&(c[h]=u)}return c};return a(s(n[t]),r==null?void 0:r.customShareInfo)}const V=(e,t)=>{e.useIn||(e.useIn=[]),nr(e.useIn,t)};function ae(e,t){return t&&e.treeShaking?e.treeShaking:e}function jr(e,t){for(const r of e){const n=t.startsWith(r.name);let o=t.replace(r.name,"");if(n){if(o.startsWith("/")){const a=r.name;return o=`.${o}`,{pkgNameOrAlias:a,expose:o,remote:r}}else if(o==="")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 qr(e,t){for(const r of e)if(t===r.name||r.alias&&t===r.alias)return r}const _t="RUNTIME-001",bt="RUNTIME-002",Rt="RUNTIME-003",St="RUNTIME-004",$t="RUNTIME-005",Ae="RUNTIME-006",wt="RUNTIME-007",Ge="RUNTIME-008",Kr="RUNTIME-009",Nt="RUNTIME-010",It="RUNTIME-011",L={[_t]:"Failed to get remoteEntry exports.",[bt]:'The remote entry interface does not contain "init"',[Rt]:"Failed to get manifest.",[St]:"Failed to locate remote.",[$t]:"Invalid loadShareSync function call from bundler runtime",[Ae]:"Invalid loadShareSync function call from runtime",[wt]:"Failed to get remote snapshot.",[Ge]:"Failed to load script resources.",[Kr]:"Please call createInstance first.",[Nt]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[It]:"The remoteEntry URL is missing from the remote snapshot."};({...L});const Tt=".then(callbacks[0]).catch(callbacks[1])";async function zr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${Tt}`)([r,n]):import(e).then(r).catch(n)}catch(o){S(`Failed to load ESM entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}async function Jr({entry:e,remoteEntryExports:t}){return new Promise((r,n)=>{try{t?r(t):typeof __system_context__>"u"?System.import(e).then(r).catch(n):new Function("callbacks",`System.import("${e}")${Tt}`)([r,n])}catch(o){S(`Failed to load SystemJS entry from "${e}". ${o instanceof Error?o.message:String(o)}`)}})}function vt(e,t,r){const{remoteEntryKey:n,entryExports:o}=De(e,t);return o||S(_t,L,{remoteName:e,remoteEntryUrl:r,remoteEntryKey:n}),o}async function Xr({name:e,globalName:t,entry:r,loaderHook:n,getEntryUrl:o}){const{entryExports:s}=De(e,t);if(s)return s;const i=o?o(r):r;return Yt(i,{attrs:{},createScriptHook:(a,l)=>{const c=n.lifecycle.createScript.emit({url:a,attrs:l});if(c&&(c instanceof HTMLScriptElement||"script"in c||"timeout"in c))return c}}).then(()=>vt(e,t,r),a=>{const l=a instanceof Error?a.message:String(a);S(Ge,L,{remoteName:e,resourceUrl:i},l)})}async function Yr({remoteInfo:e,remoteEntryExports:t,loaderHook:r,getEntryUrl:n}){const{entry:o,entryGlobalName:s,name:i,type:a}=e;switch(a){case"esm":case"module":return zr({entry:o,remoteEntryExports:t});case"system":return Jr({entry:o,remoteEntryExports:t});default:return Xr({entry:o,globalName:s,name:i,loaderHook:r,getEntryUrl:n})}}async function Zr({remoteInfo:e,loaderHook:t}){const{entry:r,entryGlobalName:n,name:o,type:s}=e,{entryExports:i}=De(o,n);return i||er(r,{attrs:{name:o,globalName:n,type:s},loaderHook:{createScriptHook:(a,l={})=>{const c=t.lifecycle.createScript.emit({url:a,attrs:l});if(c&&"url"in c)return c}}}).then(()=>vt(o,n,r)).catch(a=>{S(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error?a.message:String(a)}`)})}function Pe(e){const{entry:t,name:r}=e;return Ye(r,t)}async function ye(e){const{origin:t,remoteEntryExports:r,remoteInfo:n,getEntryUrl:o,_inErrorHandling:s=!1}=e,i=Pe(n);if(r)return r;if(!W[i]){const a=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;W[i]=a.emit({loaderHook:l,remoteInfo:n,remoteEntryExports:r}).then(c=>c||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":H)?Yr({remoteInfo:n,remoteEntryExports:r,loaderHook:l,getEntryUrl:o}):Zr({remoteInfo:n,loaderHook:l}))).catch(async c=>{const f=Pe(n),h=c instanceof Error&&c.message.includes("ScriptExecutionError");if(c instanceof Error&&c.message.includes(Ge)&&!h&&!s){const u=m=>ye({...m,_inErrorHandling:!0}),d=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:u,origin:t,remoteInfo:n,remoteEntryExports:r,globalLoading:W,uniqueKey:f});if(d)return d}throw c})}return W[i]}function ke(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||yt,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||ne}}function Qr(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function en(e,t){const r=ur(),n=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return r.length>0&&r.forEach(o=>{e!=null&&e.find(s=>s.name!==o.name)&&e.push(o)}),e&&e.length>0&&e.forEach(o=>{n.forEach(s=>{s.applyPlugin(o,t)})}),e}function tn(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 J(e){var r,n,o,s,i,a;const t={};for(const[l,c]of Object.entries(e.shared)){const f=c[0];f&&(t[l]={version:f.version,singleton:(r=f.shareConfig)==null?void 0:r.singleton,requiredVersion:((n=f.shareConfig)==null?void 0:n.requiredVersion)===!1?!1:(o=f.shareConfig)==null?void 0:o.requiredVersion,eager:f.eager,strictVersion:(s=f.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(tn))??[],shared:t}}}function At(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...e}}function rn(e,t){return t.map(r=>{const n=qr(e,r.nameOrAlias);return k(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&Qe({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:At(r)}})}function nn(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function Pt(e,t,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:i}=r;if(t.options.inBrowser){if(i.forEach(a=>{const{moduleInfo:l}=a,c=t.moduleCache.get(e.name);ye(c?{origin:t,remoteInfo:l,remoteEntryExports:c.remoteEntryExports}:{origin:t,remoteInfo:l,remoteEntryExports:void 0})}),n){const a={rel:"preload",as:"style"};o.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d}});f&&document.head.appendChild(c)})}else{const a={rel:"stylesheet",type:"text/css"};o.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d},needDeleteLink:!1});f&&document.head.appendChild(c)})}if(n){const a={rel:"preload",as:"script"};s.forEach(l=>{const{link:c,needAttach:f}=Ee({url:l,cb:()=>{},attrs:a,createLinkHook:(h,u)=>{const d=t.loaderHook.lifecycle.createLink.emit({url:h,attrs:u});if(d instanceof HTMLLinkElement)return d}});f&&document.head.appendChild(c)})}else{const a={fetchpriority:"high",type:(e==null?void 0:e.type)==="module"?"module":"text/javascript"};s.forEach(l=>{const{script:c,needAttach:f}=ot({url:l,cb:()=>{},attrs:a,createScriptHook:(h,u)=>{const d=t.loaderHook.lifecycle.createScript.emit({url:h,attrs:u});if(d instanceof HTMLScriptElement)return d},needDeleteScript:!0});f&&document.head.appendChild(c)})}}}function on(e,t,r){const n=t,o=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];o.length||o.push("default"),o.forEach(i=>{n[i]||(n[i]={})});const s={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?o:e.shareScope||"default"};return Object.defineProperty(s,"shareScopeMap",{value:n,enumerable:!1}),{remoteEntryInitOptions:s,shareScope:n[o[0]],initScope:r??[]}}var kt=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await ye({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return k(e,`remoteEntryExports is undefined
|
|
8
|
+
${Qe(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,t,r){const n=await this.getEntry();if(this.inited)return n;if(this.initPromise)return await this.initPromise,n;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:o,shareScope:s,initScope:i}=on(this.remoteInfo,this.host.shareScopeMap,r),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:s,remoteEntryInitOptions:o,initScope:i,remoteInfo:this.remoteInfo,origin:this.host});typeof(n==null?void 0:n.init)>"u"&&S(bt,L,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,J(this.host.options)),await n.init(a.shareScope,a.initScope,a.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...a,id:e,remoteSnapshot:t,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,t,r,n){const{loadFactory:o=!0}=r||{loadFactory:!0},s=await this.init(e,n);this.lib=s;let i;i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:t,moduleInfo:this.remoteInfo}),i||(i=await s.get(t)),k(i,`${Q(this.remoteInfo)} remote don't export ${t}.`);const a=ir(this.remoteInfo.name,t),l=this.wraperFactory(i,a);return o?await l():l}wraperFactory(e,t){function r(n,o){n&&typeof n=="object"&&Object.isExtensible(n)&&!Object.getOwnPropertyDescriptor(n,Symbol.for("mf_module_id"))&&Object.defineProperty(n,Symbol.for("mf_module_id"),{value:o,enumerable:!1})}return e instanceof Promise?async()=>{const n=await e();return r(n,t),n}:()=>{const n=e();return r(n,t),n}}},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(...n){return t.remove(r),e.apply(null,n)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(r=>{t=r(...e)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},P=class extends A{emit(...e){let t;const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>s===!1?!1:n<r.length?Promise.resolve(r[n++].apply(null,e)).then(o):s;t=o()}return Promise.resolve(t)}};function Ot(e,t){if(!Ce(t))return!1;if(e!==t){for(const r in e)if(!(r in t))return!1}return!0}var j=class extends A{constructor(e){super(),this.onerror=S,this.type=e}emit(e){Ce(e)||S(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const r=t(e);if(Ot(e,r))e=r;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r){Le(r),this.onerror(r)}return e}},F=class extends A{constructor(e){super(),this.onerror=S,this.type=e}emit(e){Ce(e)||S(`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 n=s=>(Le(s),this.onerror(s),e),o=s=>{if(Ot(e,s)){if(e=s,r<t.length)try{return Promise.resolve(t[r++](e)).then(o,n)}catch(i){return n(i)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(o(e))}return Promise.resolve(e)}},q=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){var n;k(sr(e),"Plugin configuration is invalid.");const r=e.name;k(r,"A name must be provided by the plugin."),this.registerPlugins[r]||(this.registerPlugins[r]=e,(n=e.apply)==null||n.call(e,t),Object.keys(this.lifecycle).forEach(o=>{const s=e[o];s&&this.lifecycle[o].on(s)}))}removePlugin(e){k(e,"A name is required.");const t=this.registerPlugins[e];k(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(r=>{r!=="name"&&this.lifecycle[r].remove(t[r])})}};function Lt(e,t){const r=lt(t);r.url||S(It,L,{remoteName:e.name});let n=Ne(t,r.url);!H&&!n.startsWith("http")&&(n=`https:${n}`),e.type=r.type,e.entryGlobalName=r.globalName,e.entry=n,e.version=t.version,e.buildVersion=t.buildVersion}function sn(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:s,id:i}=e;if(!Me(t)||!at(t)){const{remoteSnapshot:a,globalSnapshot:l}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:i});Lt(s,a);const c={remote:t,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},f=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:c,remoteInfo:s,remote:t,remoteSnapshot:a,globalSnapshot:l});return f&&Pt(s,o,f,!1),{...e,remoteSnapshot:a}}return e}}}function an(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 Mt(e,t,r,n,o={},s){const{value:i}=K(e,Q(t)),a=s||i;if(a&&!et(a)&&(r(a,t,n),a.remotesInfo)){const l=Object.keys(a.remotesInfo);for(const c of l){if(o[c])continue;o[c]=!0;const f=an(c),h=a.remotesInfo[c];Mt(e,{name:f.name,version:h.matchedVersion},r,!1,o,void 0)}}}const Se=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function cn(e,t,r,n,o){const s=[],i=[],a=[],l=new Set,c=new Set,{options:f}=e,{preloadConfig:h}=t,{depsRemote:u}=h;if(Mt(n,r,(m,y,g)=>{var $;let p;if(g)p=h;else if(Array.isArray(u)){const R=u.find(w=>w.nameOrAlias===y.name||w.nameOrAlias===y.alias);if(!R)return;p=At(R)}else if(u===!0)p=h;else return;const E=Ne(m,lt(m).url);E&&a.push({name:y.name,moduleInfo:{name:y.name,entry:E,type:"remoteEntryType"in m?m.remoteEntryType:"global",entryGlobalName:"globalName"in m?m.globalName:y.name,shareScope:"",version:"version"in m?m.version:void 0},url:E});let b="modules"in m?m.modules:[];const N=nn(p.exposes);N.length&&"modules"in m&&(b=($=m==null?void 0:m.modules)==null?void 0:$.reduce((R,w)=>((N==null?void 0:N.indexOf(w.moduleName))!==-1&&R.push(w),R),[]));function _(R){const w=R.map(M=>Ne(m,M));return p.filter?w.filter(p.filter):w}if(b){const R=b.length;for(let w=0;w<R;w++){const M=b[w],ge=`${y.name}/${M.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:M.moduleName==="."?y.name:ge,name:y.name,remoteSnapshot:m,preloadConfig:p,remote:y,origin:e}),!fr(ge)&&(p.resourceCategory==="all"?(s.push(..._(M.assets.css.async)),s.push(..._(M.assets.css.sync)),i.push(..._(M.assets.js.async)),i.push(..._(M.assets.js.sync))):p.resourceCategory==="sync"&&(s.push(..._(M.assets.css.sync)),i.push(..._(M.assets.js.sync))),hr(ge))}}},!0,{},o),o.shared&&o.shared.length>0){const m=(y,g)=>{const{shared:p}=me(e.shareScopeMap,g.sharedName,y,e.sharedHandler.hooks.lifecycle.resolveShare)||{};p&&typeof p.lib=="function"&&(g.assets.js.sync.forEach(E=>{l.add(E)}),g.assets.css.sync.forEach(E=>{c.add(E)}))};o.shared.forEach(y=>{var E;const g=(E=f.shared)==null?void 0:E[y.sharedName];if(!g)return;const p=y.version?g.find(b=>b.version===y.version):g;p&&ct(p).forEach(b=>{m(b,y)})})}const d=i.filter(m=>!l.has(m)&&!Se("script",m));return{cssAssets:s.filter(m=>!c.has(m)&&!Se("link",m)),jsAssetsWithoutEntry:d,entryAssets:a.filter(m=>!Se("script",m.url))}}const ln=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:s,remoteSnapshot:i}=e;return H?Me(o)&&at(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(Lt(n,i),cn(t,r,n,s,i)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Ct(e,t){const r=fe({name:t.name,version:t.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&K(r.remotesInfo,e.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:xe(),remoteSnapshot:fe({name:e.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:xe(),remoteSnapshot:fe({name:e.name,version:"version"in e?e.version:void 0})}}var un=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new q({beforeLoadRemoteSnapshot:new P("beforeLoadRemoteSnapshot"),loadSnapshot:new F("loadGlobalSnapshot"),loadRemoteSnapshot:new F("loadRemoteSnapshot"),afterLoadSnapshot:new F("afterLoadSnapshot")}),this.manifestLoading=ee.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,expose:r}){const{options:n}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:n,moduleInfo:e});let o=fe({name:this.HostInstance.options.name,version:this.HostInstance.options.version});o||(o={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},lr({[this.HostInstance.options.name]:o})),o&&"remotesInfo"in o&&!K(o.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(o.remotesInfo={...o==null?void 0:o.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:n,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:a});let f,h;if(l)if(et(l)){const u=H?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||"",d=await this.getManifestJson(u,e,{}),m=Ue({...e,entry:u},d);f=d,h=m}else{const{remoteSnapshot:u}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});f=u,h=c}else if(Me(e)){const u=await this.getManifestJson(e.entry,e,{}),d=Ue(e,u),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:u,from:"global"});f=m,h=d}else S(wt,L,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(c)},void 0,J(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:n,moduleInfo:e,remoteSnapshot:f}),{remoteSnapshot:f,globalSnapshot:h}}getGlobalRemoteInfo(e){return Ct(e,this.HostInstance)}async getManifestJson(e,t,r){const n=async()=>{let s=this.manifestCache.get(e);if(s)return s;try{let i=await this.loaderHook.lifecycle.fetch.emit(e,{});(!i||!(i instanceof Response))&&(i=await fetch(e,{})),s=await i.json()}catch(i){s=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:i,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),s||(delete this.manifestLoading[e],S(Rt,L,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${i}`,J(this.HostInstance.options)))}return k(s.metaData&&s.exposes&&s.shared,`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[!s.metaData&&"metaData",!s.exposes&&"exposes",!s.shared&&"shared"].filter(Boolean).join(", ")}.`),this.manifestCache.set(e,s),s},o=async()=>{const s=await n(),i=qt(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]=o().then(s=>s)),this.manifestLoading[e]}},fn=class{constructor(e){this.hooks=new q({beforeRegisterShare:new j("beforeRegisterShare"),afterResolve:new F("afterResolve"),beforeLoadShare:new F("beforeLoadShare"),loadShare:new P,resolveShare:new j("resolveShare"),initContainerShareScopeMap:new j("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,t){const{newShareInfos:r,allShareInfos:n}=gt(e,t);return Object.keys(r).forEach(o=>{r[o].forEach(s=>{s.scope.forEach(i=>{var a;this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:o,shared:s}),(a=this.shareScopeMap[i])!=null&&a[o]||this.setShared({pkgName:o,lib:s.lib,get:s.get,loaded:s.loaded||!!s.lib,shared:s,from:t.name})})})}),{newShareInfos:r,allShareInfos:n}}async loadShare(e,t){const{host:r}=this,n=Ke({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&await Promise.all(n.scope.map(async a=>{await Promise.all(this.initializeSharing(a,{strategy:n.strategy}))}));const{shareInfo:o}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:n,shared:r.options.shared,origin:r});k(o,`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{shared:s,useTreesShaking:i}=me(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(s){const a=ae(s,i);if(a.lib)return V(a,r.options.name),a.lib;if(a.loading&&!a.loaded){const l=await a.loading;return a.loaded=!0,a.lib||(a.lib=l),V(a,r.options.name),l}else{const c=(async()=>{const f=await a.get();return V(a,r.options.name),a.loaded=!0,a.lib=f,f})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:r.options.name,lib:null,loading:c,treeShaking:i?a:void 0}),c}}else{if(t!=null&&t.customShareInfo)return!1;const a=te(o.treeShaking),l=ae(o,a),f=(async()=>{const h=await l.get();l.lib=h,l.loaded=!0,V(l,r.options.name);const{shared:u,useTreesShaking:d}=me(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(u){const m=ae(u,d);m.lib=h,m.loaded=!0,u.from=o.from}return h})();return this.setShared({pkgName:e,loaded:!1,shared:o,from:r.options.name,lib:null,loading:f,treeShaking:a?l:void 0}),f}}initializeSharing(e=ne,t){const{host:r}=this,n=t==null?void 0:t.from,o=t==null?void 0:t.strategy;let s=t==null?void 0:t.initScope;const i=[];if(n!=="build"){const{initTokens:u}=this;s||(s=[]);let d=u[e];if(d||(d=u[e]={from:this.host.name}),s.indexOf(d)>=0)return i;s.push(d)}const a=this.shareScopeMap,l=r.options.name;a[e]||(a[e]={});const c=a[e],f=(u,d)=>{var b;const{version:m,eager:y}=d;c[u]=c[u]||{};const g=c[u],p=g[m]&&ae(g[m]),E=!!(p&&("eager"in p&&p.eager||"shareConfig"in p&&((b=p.shareConfig)!=null&&b.eager)));(!p||p.strategy!=="loaded-first"&&!p.loaded&&(!y!=!E?y:l>g[m].from))&&(g[m]=d)},h=async u=>{const{module:d}=await r.remoteHandler.getRemoteModuleAndOptions({id:u});let m;try{m=await d.getEntry()}catch(y){if(m=await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:u,error:y,from:"runtime",lifecycle:"beforeLoadShare",origin:r}),!m)return}finally{m!=null&&m.init&&!d.initing&&(d.remoteEntryExports=m,await d.init(void 0,void 0,s))}};return Object.keys(r.options.shared).forEach(u=>{r.options.shared[u].forEach(d=>{d.scope.includes(e)&&f(u,d)})}),(r.options.shareStrategy==="version-first"||o==="version-first")&&r.options.remotes.forEach(u=>{u.shareScope===e&&i.push(h(u.name))}),i}loadShareSync(e,t){const{host:r}=this,n=Ke({pkgName:e,extraOptions:t,shareInfos:r.options.shared});n!=null&&n.scope&&n.scope.forEach(i=>{this.initializeSharing(i,{strategy:n.strategy})});const{shared:o,useTreesShaking:s}=me(this.shareScopeMap,e,n,this.hooks.lifecycle.resolveShare)||{};if(o){if(typeof o.lib=="function")return V(o,r.options.name),o.loaded||(o.loaded=!0,o.from===r.options.name&&(n.loaded=!0)),o.lib;if(typeof o.get=="function"){const i=o.get();if(!(i instanceof Promise))return V(o,r.options.name),this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:i,shared:o}),i}}if(n.lib)return n.loaded||(n.loaded=!0),n.lib;if(n.get){const i=n.get();return i instanceof Promise&&S((t==null?void 0:t.from)==="build"?$t:Ae,L,{hostName:r.options.name,sharedPkgName:e},void 0,J(r.options)),n.lib=i,this.setShared({pkgName:e,loaded:!0,from:r.options.name,lib:n.lib,shared:n}),n.lib}S(Ae,L,{hostName:r.options.name,sharedPkgName:e},void 0,J(r.options))}initShareScopeMap(e,t,r={}){const{host:n}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:n.options,origin:n,scopeName:e,hostShareScopeMap:r.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:r,lib:n,loading:o,loaded:s,get:i,treeShaking:a}){const{version:l,scope:c="default",...f}=t,h=Array.isArray(c)?c:[c],u=d=>{const m=(g,p,E)=>{E&&!g[p]&&(g[p]=E)},y=a?d.treeShaking:d;m(y,"loaded",s),m(y,"loading",o),m(y,"get",i)};h.forEach(d=>{this.shareScopeMap[d]||(this.shareScopeMap[d]={}),this.shareScopeMap[d][e]||(this.shareScopeMap[d][e]={}),this.shareScopeMap[d][e][l]||(this.shareScopeMap[d][e][l]={version:l,scope:[d],...f,lib:n});const m=this.shareScopeMap[d][e][l];u(m),r&&m.from!==r&&(m.from=r)})}_setGlobalShareScopeMap(e){const t=Et(),r=e.id||e.name;r&&!t[r]&&(t[r]=this.shareScopeMap)}},hn=class{constructor(e){this.hooks=new q({beforeRegisterRemote:new j("beforeRegisterRemote"),registerRemote:new j("registerRemote"),beforeRequest:new F("beforeRequest"),onLoad:new P("onLoad"),handlePreloadModule:new A("handlePreloadModule"),errorLoadRemote:new P("errorLoadRemote"),beforePreloadRemote:new P("beforePreloadRemote"),generatePreloadAssets:new P("generatePreloadAssets"),afterPreloadRemote:new P,loadEntry:new P}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((r,n)=>(this.registerRemote(n,r,{force:!1}),r),e.remotes)}setIdToRemoteMap(e,t){const{remote:r,expose:n}=t,{name:o,alias:s}=r;if(this.idToRemoteMap[e]={name:r.name,expose:n},s&&e.startsWith(o)){const i=e.replace(o,s);this.idToRemoteMap[i]={name:r.name,expose:n};return}if(s&&e.startsWith(s)){const i=e.replace(s,o);this.idToRemoteMap[i]={name:r.name,expose:n}}}async loadRemote(e,t){const{host:r}=this;try{const{loadFactory:n=!0}=t||{loadFactory:!0},{module:o,moduleOptions:s,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:a,remote:l,expose:c,id:f,remoteSnapshot:h}=i,u=await o.get(f,c,t,h),d=await this.hooks.lifecycle.onLoad.emit({id:f,pkgNameOrAlias:a,expose:c,exposeModule:n?u:void 0,exposeModuleFactory:n?void 0:u,remote:l,options:s,moduleInstance:o,origin:r});return this.setIdToRemoteMap(e,i),typeof d=="function"?d:u}catch(n){const{from:o="runtime"}=t||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:n,from:o,lifecycle:"onLoad",origin:r});if(!s)throw n;return s}}async preloadRemote(e){const{host:t}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const r=rn(t.options.remotes,e);await Promise.all(r.map(async n=>{const{remote:o}=n,s=ke(o),{globalSnapshot:i,remoteSnapshot:a}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:n,remote:o,remoteInfo:s,globalSnapshot:i,remoteSnapshot:a});l&&Pt(s,t,l)}))}registerRemotes(e,t){const{host:r}=this;e.forEach(n=>{this.registerRemote(n,r.options.remotes,{force:t==null?void 0:t.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:r}=e;let n;try{n=await this.hooks.lifecycle.beforeRequest.emit({id:r,options:t.options,origin:t})}catch(d){if(n=await this.hooks.lifecycle.errorLoadRemote.emit({id:r,options:t.options,origin:t,from:"runtime",error:d,lifecycle:"beforeRequest"}),!n)throw d}const{id:o}=n,s=jr(t.options.remotes,o);s||S(St,L,{hostName:t.options.name,requestId:o},void 0,J(t.options));const{remote:i}=s,a=ke(i),l=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:o,...s,options:t.options,origin:t,remoteInfo:a}),{remote:c,expose:f}=l;k(c&&f,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);let h=t.moduleCache.get(c.name);const u={host:t,remoteInfo:a};return h||(h=new kt(u),t.moduleCache.set(c.name,h)),{module:h,moduleOptions:u,remoteMatchInfo:l}}registerRemote(e,t,r){const{host:n}=this,o=()=>{if(e.alias){const i=t.find(a=>{var l;return e.alias&&(a.name.startsWith(e.alias)||((l=a.alias)==null?void 0:l.startsWith(e.alias)))});k(!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&&H&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=ne),e.type||(e.type=yt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:n});const s=t.find(i=>i.name===e.name);if(!s)o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n});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),o(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:n}),Ze(i.join(" ")))}}removeRemote(e){var t;try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(i=>i.name===n);o!==-1&&r.options.remotes.splice(o,1);const s=r.moduleCache.get(e.name);if(s){const i=s.remoteInfo,a=i.entryGlobalName;I[a]&&((t=Object.getOwnPropertyDescriptor(I,a))!=null&&t.configurable?delete I[a]:I[a]=void 0);const l=Pe(s.remoteInfo);W[l]&&delete W[l],r.snapshotHandler.manifestCache.delete(i.entry);let c=i.buildVersion?Ye(i.name,i.buildVersion):i.name;const f=I.__FEDERATION__.__INSTANCES__.findIndex(u=>i.buildVersion?u.options.id===c:u.name===c);if(f!==-1){const u=I.__FEDERATION__.__INSTANCES__[f];c=u.options.id||c;const d=Et();let m=!0;const y=[];Object.keys(d).forEach(g=>{const p=d[g];p&&Object.keys(p).forEach(E=>{const b=p[E];b&&Object.keys(b).forEach(N=>{const _=b[N];_&&Object.keys(_).forEach($=>{const R=_[$];R&&typeof R=="object"&&R.from===i.name&&(R.loaded||R.loading?(R.useIn=R.useIn.filter(w=>w!==i.name),R.useIn.length?m=!1:y.push([g,E,N,$])):y.push([g,E,N,$]))})})})}),m&&(u.shareScopeMap={},delete d[c]),y.forEach(([g,p,E,b])=>{var N,_,$;($=(_=(N=d[g])==null?void 0:N[p])==null?void 0:_[E])==null||delete $[b]}),I.__FEDERATION__.__INSTANCES__.splice(f,1)}const{hostGlobalSnapshot:h}=Ct(e,r);if(h){const u=h&&"remotesInfo"in h&&h.remotesInfo&&K(h.remotesInfo,e.name).key;u&&(delete h.remotesInfo[u],ee.__FEDERATION__.__MANIFEST_LOADING__[u]&&delete ee.__FEDERATION__.__MANIFEST_LOADING__[u])}r.moduleCache.delete(e.name)}}catch(r){ve.error(`removeRemote failed: ${r instanceof Error?r.message:String(r)}`)}}};const dn=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;var mn=class{constructor(e){this.hooks=new q({beforeInit:new j("beforeInit"),init:new A,beforeInitContainer:new F("beforeInitContainer"),initContainer:new F("initContainer")}),this.version="2.2.0",this.moduleCache=new Map,this.loaderHook=new q({getModuleInfo:new A,createScript:new A,createLink:new A,fetch:new P,loadEntryError:new P,getModuleFactory:new P}),this.bridgeHook=new q({beforeBridgeRender:new A,afterBridgeRender:new A,beforeBridgeDestroy:new A,afterBridgeDestroy:new A});const t=dn?[sn(),ln()]:[],r={id:Qr(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:H};this.name=e.name,this.options=r,this.snapshotHandler=new un(this),this.sharedHandler=new fn(this),this.remoteHandler=new hn(this),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&&S(it(Nt,L)),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=ne,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,r){const n=ke({name:e,entry:t}),o=new kt({host:this,remoteInfo:n});return o.remoteEntryExports=r,this.moduleCache.set(e,o),o}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{allShareInfos:r}=gt(e,t),{userOptions:n,options:o}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:r}),s=this.remoteHandler.formatAndRegisterRemote(o,n),{allShareInfos:i}=this.sharedHandler.registerShared(o,n),a=[...o.plugins];n.plugins&&n.plugins.forEach(c=>{a.includes(c)||a.push(c)});const l={...e,...t,plugins:a,remotes:s,shared:i};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){const t=en(e,this);this.options.plugins=this.options.plugins.reduce((r,n)=>(n&&r&&!r.find(o=>o.name===n.name)&&r.push(n),r),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};let pn=null;function Dt(){return pn}ar(mn);function Ft(e,t){return e.map(r=>{const n={...r,path:t+r.path};return r.children&&r.children.length>0&&(n.children=Ft(r.children,t)),n})}function yn(e){const{router:t,basename:r,memoryRoute:n,hashRoute:o}=e,s=t.getRoutes().sort((u,d)=>u.path.split("/").filter(m=>m).length-d.path.split("/").filter(m=>m).length),i=new Map,a=new Set;s.forEach(u=>{i.set(u.path,u)});const l=(u,d)=>`${u}/${d}`.replace(/\/+/g,"/").replace(/\/$/,"")||"/",c=(u,d="")=>{if(!u.children||u.children.length===0)return u;for(let m=0;m<u.children.length;m++){const y=u.children[m],g=l(d,y.path),p=i.get(g);if(p&&!a.has(p)){const E={...p,path:y.path};u.children[m]=E,a.add(p),c(E,g)}}return u};let f=[];for(const u of s)if(!a.has(u)){const d=c(u,u.path);a.add(u),f.push(d)}let h;return n?h=ce.createMemoryHistory(r):o?(h=ce.createWebHashHistory(),r&&(f=Ft(f,r))):h=ce.createWebHistory(r),{history:h,routes:f}}function gn(e){const t=new Map,r=Dt();return()=>({__APP_VERSION__:"2.2.0",async render(n){var m,y,g;D.debug("createBridgeComponent render Info",n);const{moduleName:o,dom:s,basename:i,memoryRoute:a,hashRoute:l,...c}=n,f=Gt.createApp(e.rootComponent,c);t.set(s,f);const h=await((g=(y=(m=r==null?void 0:r.bridgeHook)==null?void 0:m.lifecycle)==null?void 0:y.beforeBridgeRender)==null?void 0:g.emit(n)),u=h&&typeof h=="object"&&(h!=null&&h.extraProps)?h==null?void 0:h.extraProps:{},d=e.appOptions({app:f,basename:i,memoryRoute:a,hashRoute:l,...c,...u});if(d!=null&&d.router){const{history:p,routes:E}=yn({router:d.router,basename:n.basename,memoryRoute:n.memoryRoute,hashRoute:n.hashRoute}),b=ce.createRouter({...d.router.options,history:p,routes:E});D.debug("createBridgeComponent render router info>>>",{moduleName:o,router:b}),a&&await b.push(a.entryPath),f.use(b)}f.mount(s)},destroy(n){D.debug("createBridgeComponent destroy Info",n);const o=t.get(n==null?void 0:n.dom);o==null||o.unmount()}})}function En(){const e=new PopStateEvent("popstate",{state:window.history.state});window.dispatchEvent(e)}const _n=v.defineComponent({name:"RemoteApp",props:{moduleName:String,basename:String,memoryRoute:Object,hashRoute:Boolean,providerInfo:Function,rootAttrs:Object},inheritAttrs:!1,setup(e){const t=v.ref(null),r=v.ref(null),n=v.ref(""),o=Oe.useRoute(),s=Dt(),i=v.useAttrs(),a=async()=>{var u,d,m,y;const c=(u=e.providerInfo)==null?void 0:u.call(e);r.value=c;let f={...i,moduleName:e.moduleName,dom:t.value,basename:e.basename,memoryRoute:e.memoryRoute,hashRoute:e.hashRoute};D.debug("createRemoteAppComponent LazyComponent render >>>",f);const h=await((y=(m=(d=s==null?void 0:s.bridgeHook)==null?void 0:d.lifecycle)==null?void 0:m.beforeBridgeRender)==null?void 0:y.emit(f))||{};f={...f,...h.extraProps},c.render(f)},l=v.watch(()=>o==null?void 0:o.path,c=>{c!==o.path&&a(),n.value!==""&&n.value!==c&&(D.debug("createRemoteAppComponent dispatchPopstateEnv >>>",{...e,pathname:o.path}),En()),n.value=c});return v.onMounted(()=>{a()}),v.onBeforeUnmount(()=>{var c;D.debug("createRemoteAppComponent LazyComponent destroy >>>",{...e}),l(),(c=r.value)==null||c.destroy({dom:t.value})}),()=>v.createVNode("div",v.mergeProps(e.rootAttrs||{},{ref:t}),null)}});function Ht(e){return v.defineAsyncComponent({__APP_VERSION__:"2.2.0",...e.asyncComponentOptions,loader:async()=>{var l,c;const t=Oe.useRoute();let r="/";const n=(c=(l=t==null?void 0:t.matched)==null?void 0:l[0])==null?void 0:c.path;n&&(n.endsWith("/:pathMatch(.*)*")?r=n.replace("/:pathMatch(.*)*",""):r=t.matched[0].path);const o=(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[o];if(D.debug("createRemoteAppComponent LazyComponent loadRemote info >>>",{moduleName:i,module:s,exportName:o,basename:r,route:t}),o in s&&typeof a=="function")return{render(){return v.h(_n,{moduleName:i,providerInfo:a,basename:r,rootAttrs:e.rootAttrs})}};throw new Error("module not found")}})}function bn(e){return D.warn("createRemoteAppComponent is deprecated, please use createRemoteAppComponent instead!"),Ht(e)}exports.createBridgeComponent=gn;exports.createRemoteAppComponent=Ht;exports.createRemoteComponent=bn;
|