@signalk/server-admin-ui 2.23.0 → 2.23.2
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/package.json +1 -1
- package/public/assets/adminUI__loadShare__react__loadShare__.mjs-D8asHvWX.js +2 -0
- package/public/assets/adminUI__loadShare__react__loadShare__.mjs_commonjs-proxy-ByXi4yJ8.js +2 -0
- package/public/assets/adminUI__loadShare__react_mf_2_dom__loadShare__.mjs-DH1wL779.js +2 -0
- package/public/assets/bootstrap-bNZv2cMS.js +818 -0
- package/public/assets/hostInit-BMKH-INB.js +2 -2
- package/public/assets/{index-03avmwGu.js → index-BEQk0SN_.js} +2 -2
- package/public/assets/{index-DGNZrxCr.js → index-C0euSWDO.js} +4 -4
- package/public/assets/index-CLC5Par7.js +3 -0
- package/public/assets/index.cjs-qNTcCtpj.js +8 -0
- package/public/assets/loadingerror-Beick9Sd.js +2 -0
- package/public/assets/runtimeInit-DE95pSy4.js +2 -0
- package/public/index.html +3 -2
- package/public/remoteEntry.js +2 -2
- package/public/assets/_commonjsHelpers-D6-XlEtG.js +0 -2
- package/public/assets/adminUI__loadShare__react__loadShare__-BXV3lg18.js +0 -2
- package/public/assets/adminUI__mf_v__runtimeInit__mf_v__-OBqvctZP.js +0 -8
- package/public/assets/bootstrap-CX1Fo5Ij.js +0 -818
- package/public/assets/index-DweN4-6z.js +0 -3
- package/public/assets/loadingerror-BhQSZDj4.js +0 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var N={},m={},oe={};const nr="federation-manifest.json",Fe=".json",rt="FEDERATION_DEBUG",T={AT:"@",HYPHEN:"-",SLASH:"/"},v={[T.AT]:"scope_",[T.HYPHEN]:"_",[T.SLASH]:"__"},_e={[v[T.AT]]:T.AT,[v[T.HYPHEN]]:T.HYPHEN,[v[T.SLASH]]:T.SLASH},De=":",Oe="mf-manifest.json",Pe="mf-stats.json",or={NPM:"npm",APP:"app"},sr="__MF_DEVTOOLS_MODULE_INFO__",ir="ENCODE_NAME_PREFIX",ar=".federation",cr={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var lr=Object.freeze({__proto__:null}),ur=Object.freeze({__proto__:null}),fr=Object.freeze({__proto__:null}),hr=Object.freeze({__proto__:null});function He(){return typeof window<"u"&&typeof window.document<"u"}function nt(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function dr(){try{if(He()&&window.localStorage)return!!localStorage.getItem(rt)}catch{return!1}return!1}function Ae(){return typeof process<"u"&&oe&&oe.FEDERATION_DEBUG?!!oe.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:dr()}const ot=function(){return typeof process<"u"&&oe?oe:{}},st="[ Federation Runtime ]",pr=(t,e,r=De)=>{const n=t.split(r),o=ot().NODE_ENV==="development"&&e,i="*",s=a=>a.startsWith("http")||a.includes(Fe);if(n.length>=2){let[a,...l]=n;t.startsWith(r)&&(a=n.slice(0,2).join(r),l=[o||n.slice(2).join(r)]);let c=o||l.join(r);return s(c)?{name:a,entry:c}:{name:a,version:c||i}}else if(n.length===1){const[a]=n;return o&&s(o)?{name:a,entry:o}:{name:a,version:o||i}}else throw`Invalid entry value: ${t}`},mr=function(...t){return t.length?t.reduce((e,r)=>r?e?`${e}${De}${r}`:r:e,""):""},Ce=function(t,e="",r=!1){try{const n=r?".js":"";return`${e}${t.replace(new RegExp(`${T.AT}`,"g"),v[T.AT]).replace(new RegExp(`${T.HYPHEN}`,"g"),v[T.HYPHEN]).replace(new RegExp(`${T.SLASH}`,"g"),v[T.SLASH])}${n}`}catch(n){throw n}},Er=function(t,e,r){try{let n=t;if(e){if(!n.startsWith(e))return n;n=n.replace(new RegExp(e,"g"),"")}return n=n.replace(new RegExp(`${v[T.AT]}`,"g"),_e[v[T.AT]]).replace(new RegExp(`${v[T.SLASH]}`,"g"),_e[v[T.SLASH]]).replace(new RegExp(`${v[T.HYPHEN]}`,"g"),_e[v[T.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(n){throw n}},_r=(t,e)=>{if(!t)return"";let r=t;return r==="."&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),Ce(r,"__federation_expose_",e)},yr=(t,e)=>t?Ce(t,"__federation_shared_",e):"",gr=(t,e)=>{if("getPublicPath"in t){let r;return t.getPublicPath.startsWith("function")?r=new Function("return "+t.getPublicPath)()():r=new Function(t.getPublicPath)(),`${r}${e}`}else return"publicPath"in t?!He()&&!nt()&&"ssrPublicPath"in t?`${t.ssrPublicPath}${e}`:`${t.publicPath}${e}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",t,e),"")},Sr=(t,e)=>{t||it(e)},it=t=>{throw new Error(`${st}: ${t}`)},at=t=>{console.warn(`${st}: ${t}`)};function br(t){try{return JSON.stringify(t,null,2)}catch{return""}}const Rr=/^([\d^=v<>~]|[*xX]$)/;function Ir(t){return Rr.test(t)}const K=(t,e)=>{if(!t)return e;const n=(o=>{if(o===".")return"";if(o.startsWith("./"))return o.replace("./","");if(o.startsWith("/")){const i=o.slice(1);return i.endsWith("/")?i.slice(0,-1):i}return o})(t);return n?n.endsWith("/")?`${n}${e}`:`${n}/${e}`:e};function ct(t){return t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function Nr(t,e={}){const{remotes:r={},overrides:n={},version:o}=e;let i;const s=()=>"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&o?ct(o):t.metaData.publicPath:t.metaData.getPublicPath,a=Object.keys(n);let l={};Object.keys(r).length||(l=t.remotes?.reduce((p,S)=>{let R;const w=S.federationContainerName;return a.includes(w)?R=n[w]:"version"in S?R=S.version:R=S.entry,p[w]={matchedVersion:R},p},{})||{}),Object.keys(r).forEach(p=>l[p]={matchedVersion:a.includes(p)?n[p]:r[p]});const{remoteEntry:{path:c,name:u,type:d},types:f={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:h},globalName:E,ssrRemoteEntry:g}=t.metaData,{exposes:_}=t;let y={version:o||"",buildVersion:h,globalName:E,remoteEntry:K(c,u),remoteEntryType:d,remoteTypes:K(f.path,f.name),remoteTypesZip:f.zip||"",remoteTypesAPI:f.api||"",remotesInfo:l,shared:t?.shared.map(p=>({assets:p.assets,sharedName:p.name,version:p.version,usedExports:p.referenceExports||[]})),modules:_?.map(p=>({moduleName:p.name,modulePath:p.path,assets:p.assets}))};if(t.metaData?.prefetchInterface){const p=t.metaData.prefetchInterface;y={...y,prefetchInterface:p}}if(t.metaData?.prefetchEntry){const{path:p,name:S,type:R}=t.metaData.prefetchEntry;y={...y,prefetchEntry:K(p,S),prefetchEntryType:R}}if("publicPath"in t.metaData?i={...y,publicPath:s(),ssrPublicPath:t.metaData.ssrPublicPath}:i={...y,getPublicPath:s()},g){const p=K(g.path,g.name);i.ssrRemoteEntry=p,i.ssrRemoteEntryType=g.type||"commonjs-module"}return i}function $r(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(Fe))}function Tr(t){if(!t)return{statsFileName:Pe,manifestFileName:Oe};let e=typeof t=="boolean"?"":t.filePath||"",r=typeof t=="boolean"?"":t.fileName||"";const n=".json",o=l=>l.endsWith(n)?l:`${l}${n}`,i=(l,c)=>l.replace(n,`${c}${n}`),s=r?o(r):Oe,a=r?i(s,"-stats"):Pe;return{statsFileName:K(e,a),manifestFileName:K(e,s)}}const lt="[ Module Federation ]",ne=console,wr=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Mr(){try{const t=new Error().stack;if(!t)return;const[,...e]=t.split(`
|
|
2
|
+
`),r=e.filter(o=>!wr.some(i=>o.includes(i)));return r.length?`Stack trace:
|
|
3
|
+
${r.slice(0,5).join(`
|
|
4
|
+
`)}`:void 0}catch{return}}class ut{constructor(e,r=ne){this.prefix=e,this.delegate=r??ne}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??ne}emit(e,r){const n=this.delegate,i=Ae()?Mr():void 0,s=i?[...r,i]:r,a=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];case"debug":default:return["debug","log"]}})();for(const l of a){const c=n[l];if(typeof c=="function"){c.call(n,this.prefix,...s);return}}for(const l of a){const c=ne[l];if(typeof c=="function"){c.call(ne,this.prefix,...s);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){Ae()&&this.emit("debug",e)}}function ft(t){return new ut(t)}function ht(t){const e=new ut(t);return Object.defineProperty(e,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),e}function Or(t,e,r){if(t.__mf_infrastructure_logger__&&e?.getInfrastructureLogger)try{const n=e.getInfrastructureLogger(r);n&&typeof n=="object"&&(typeof n.log=="function"||typeof n.info=="function"||typeof n.warn=="function"||typeof n.error=="function")&&t.setDelegate(n)}catch{t.setDelegate(void 0)}}const Pr=ft(lt),Ar=ht(lt);async function xe(t,e){try{return await t()}catch(r){!e&&at(r);return}}function Ge(t,e){const r=/^(https?:)?\/\//i,n=t.replace(r,"").replace(/\/$/,""),o=e.replace(r,"").replace(/\/$/,"");return n===o}function dt(t){let e=null,r=!0,n=2e4,o;const i=document.getElementsByTagName("script");for(let a=0;a<i.length;a++){const l=i[a],c=l.getAttribute("src");if(c&&Ge(c,t.url)){e=l,r=!1;break}}if(!e){const a=t.attrs;e=document.createElement("script"),e.type=a?.type==="module"?"module":"text/javascript";let l;t.createScriptHook&&(l=t.createScriptHook(t.url,t.attrs),l instanceof HTMLScriptElement?e=l:typeof l=="object"&&("script"in l&&l.script&&(e=l.script),"timeout"in l&&l.timeout&&(n=l.timeout))),e.src||(e.src=t.url),a&&!l&&Object.keys(a).forEach(c=>{e&&(c==="async"||c==="defer"?e[c]=a[c]:e.getAttribute(c)||e.setAttribute(c,a[c]))})}const s=async(a,l)=>{clearTimeout(o);const c=()=>{l?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(l):t?.cb&&t?.cb()};if(e&&(e.onerror=null,e.onload=null,xe(()=>{const{needDeleteScript:u=!0}=t;u&&e?.parentNode&&e.parentNode.removeChild(e)}),a&&typeof a=="function")){const u=a(l);if(u instanceof Promise){const d=await u;return c(),d}return c(),u}c()};return e.onerror=s.bind(null,e.onerror),e.onload=s.bind(null,e.onload),o=setTimeout(()=>{s(null,new Error(`Remote script "${t.url}" time-outed.`))},n),{script:e,needAttach:r}}function vr(t){let e=null,r=!0;const n=document.getElementsByTagName("link");for(let i=0;i<n.length;i++){const s=n[i],a=s.getAttribute("href"),l=s.getAttribute("rel");if(a&&Ge(a,t.url)&&l===t.attrs.rel){e=s,r=!1;break}}if(!e){e=document.createElement("link"),e.setAttribute("href",t.url);let i;const s=t.attrs;t.createLinkHook&&(i=t.createLinkHook(t.url,s),i instanceof HTMLLinkElement&&(e=i)),s&&!i&&Object.keys(s).forEach(a=>{e&&!e.getAttribute(a)&&e.setAttribute(a,s[a])})}const o=(i,s)=>{const a=()=>{s?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(s):t?.cb&&t?.cb()};if(e&&(e.onerror=null,e.onload=null,xe(()=>{const{needDeleteLink:l=!0}=t;l&&e?.parentNode&&e.parentNode.removeChild(e)}),i)){const l=i(s);return a(),l}a()};return e.onerror=o.bind(null,e.onerror),e.onload=o.bind(null,e.onload),{link:e,needAttach:r}}function kr(t,e){const{attrs:r={},createScriptHook:n}=e;return new Promise((o,i)=>{const{script:s,needAttach:a}=dt({url:t,cb:o,onErrorCallback:i,attrs:{fetchpriority:"high",...r},createScriptHook:n,needDeleteScript:!0});a&&document.head.appendChild(s)})}const Lr=(t,e,r,n)=>{e(new Error("createScriptNode is disabled in non-Node.js environment"))},Fr=(t,e)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")};function Dr(t,e,r){return function(n){if(n===!1)return!1;if(typeof n>"u")return t?e:!1;if(n===!0)return e;if(n&&typeof n=="object")return{...e,...n};throw new Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}const Hr=t=>t;m.BROWSER_LOG_KEY=rt;m.ENCODE_NAME_PREFIX=ir;m.EncodedNameTransformMap=_e;m.FederationModuleManifest=nr;m.MANIFEST_EXT=Fe;m.MFModuleType=or;m.MFPrefetchCommon=cr;m.MODULE_DEVTOOL_IDENTIFIER=sr;m.ManifestFileName=Oe;m.NameTransformMap=v;m.NameTransformSymbol=T;m.SEPARATOR=De;m.StatsFileName=Pe;m.TEMP_DIR=ar;m.assert=Sr;m.bindLoggerToCompiler=Or;m.composeKeyWithSeparator=mr;m.containerPlugin=lr;m.containerReferencePlugin=ur;m.createInfrastructureLogger=ht;m.createLink=vr;m.createLogger=ft;m.createModuleFederationConfig=Hr;m.createScript=dt;m.createScriptNode=Lr;m.decodeName=Er;m.encodeName=Ce;m.error=it;m.generateExposeFilename=_r;m.generateShareFilename=yr;m.generateSnapshotFromManifest=Nr;m.getManifestFileName=Tr;m.getProcessEnv=ot;m.getResourceUrl=gr;m.inferAutoPublicPath=ct;m.infrastructureLogger=Ar;m.isBrowserEnv=He;m.isDebugMode=Ae;m.isManifestProvider=$r;m.isReactNativeEnv=nt;m.isRequiredVersion=Ir;m.isStaticResourcesEqual=Ge;m.loadScript=kr;m.loadScriptNode=Fr;m.logger=Pr;m.moduleFederationPlugin=fr;m.normalizeOptions=Dr;m.parseEntry=pr;m.safeToString=br;m.safeWrapper=xe;m.sharePlugin=hr;m.simpleJoinRemoteEntry=K;m.warn=at;var M={};const pt="RUNTIME-001",mt="RUNTIME-002",Et="RUNTIME-003",_t="RUNTIME-004",yt="RUNTIME-005",gt="RUNTIME-006",St="RUNTIME-007",bt="RUNTIME-008",Rt="RUNTIME-009",It="TYPE-001",Nt="BUILD-001",$t="BUILD-002",Cr=t=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t.split("-")[0].toLowerCase()}#${t.toLowerCase()}`,xr=(t,e,r,n)=>{const o=[`${[e[t]]} #${t}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(Cr(t)),n&&o.push(`Original Error Message:
|
|
5
|
+
${n}`),o.join(`
|
|
6
|
+
`)},Tt={[pt]:"Failed to get remoteEntry exports.",[mt]:'The remote entry interface does not contain "init"',[Et]:"Failed to get manifest.",[_t]:"Failed to locate remote.",[yt]:"Invalid loadShareSync function call from bundler runtime",[gt]:"Invalid loadShareSync function call from runtime",[St]:"Failed to get remote snapshot.",[bt]:"Failed to load script resources.",[Rt]:"Please call createInstance first."},wt={[It]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},Mt={[Nt]:"Failed to find expose module.",[$t]:"PublicPath is required in prod mode."},Gr={...Tt,...wt,...Mt};M.BUILD_001=Nt;M.BUILD_002=$t;M.RUNTIME_001=pt;M.RUNTIME_002=mt;M.RUNTIME_003=Et;M.RUNTIME_004=_t;M.RUNTIME_005=yt;M.RUNTIME_006=gt;M.RUNTIME_007=St;M.RUNTIME_008=bt;M.RUNTIME_009=Rt;M.TYPE_001=It;M.buildDescMap=Mt;M.errorDescMap=Gr;M.getShortErrorMsg=xr;M.runtimeDescMap=Tt;M.typeDescMap=wt;var b=m,I=M;const Z="[ Federation Runtime ]",ve=b.createLogger(Z);function A(t,e){t||G(e)}function G(t){throw t instanceof Error?(t.message.startsWith(Z)||(t.message=`${Z}: ${t.message}`),t):new Error(`${Z}: ${t}`)}function he(t){t instanceof Error&&(t.message.startsWith(Z)||(t.message=`${Z}: ${t.message}`)),ve.warn(t)}function Ur(t,e){return t.findIndex(r=>r===e)===-1&&t.push(e),t}function ae(t){return"version"in t&&t.version?`${t.name}:${t.version}`:"entry"in t&&t.entry?`${t.name}:${t.entry}`:`${t.name}`}function Ue(t){return typeof t.entry<"u"}function Ot(t){return!t.entry.includes(".json")}async function Br(t,e){try{return await t()}catch(r){!e&&he(r);return}}function Be(t){return t&&typeof t=="object"}const Vr=Object.prototype.toString;function Wr(t){return Vr.call(t)==="[object Object]"}function jr(t,e){const r=/^(https?:)?\/\//i,n=t.replace(r,"").replace(/\/$/,""),o=e.replace(r,"").replace(/\/$/,"");return n===o}function Pt(t){return Array.isArray(t)?t:[t]}function At(t){const e={url:"",type:"global",globalName:""};return b.isBrowserEnv()||b.isReactNativeEnv()||!("ssrRemoteEntry"in t)?"remoteEntry"in t?{url:t.remoteEntry,type:t.remoteEntryType,globalName:t.globalName}:e:"ssrRemoteEntry"in t?{url:t.ssrRemoteEntry||e.url,type:t.ssrRemoteEntryType||e.type,globalName:t.globalName}:e}const Kr=(t,e)=>{let r;return t.endsWith("/")?r=t.slice(0,-1):r=t,e.startsWith(".")&&(e=e.slice(1)),r=r+e,r},$=typeof globalThis=="object"?globalThis:window,k=(()=>{try{return document.defaultView}catch{return $}})(),z=k;function ye(t,e,r){Object.defineProperty(t,e,{value:r,configurable:!1,writable:!0})}function ge(t,e){return Object.hasOwnProperty.call(t,e)}ge($,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ye($,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const V=$.__GLOBAL_LOADING_REMOTE_ENTRY__;function vt(t){ge(t,"__VMOK__")&&!ge(t,"__FEDERATION__")&&ye(t,"__FEDERATION__",t.__VMOK__),ge(t,"__FEDERATION__")||(ye(t,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),ye(t,"__VMOK__",t.__FEDERATION__)),t.__FEDERATION__.__GLOBAL_PLUGIN__??=[],t.__FEDERATION__.__INSTANCES__??=[],t.__FEDERATION__.moduleInfo??={},t.__FEDERATION__.__SHARE__??={},t.__FEDERATION__.__MANIFEST_LOADING__??={},t.__FEDERATION__.__PRELOADED_MAP__??=new Map}vt($);vt(k);function kt(){$.__FEDERATION__.__GLOBAL_PLUGIN__=[],$.__FEDERATION__.__INSTANCES__=[],$.__FEDERATION__.moduleInfo={},$.__FEDERATION__.__SHARE__={},$.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(V).forEach(t=>{delete V[t]})}function Lt(t){$.__FEDERATION__.__INSTANCES__.push(t)}function Ft(){return $.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function Dt(t,e=b.isDebugMode()){e&&($.__FEDERATION__.__DEBUG_CONSTRUCTOR__=t,$.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.0.1")}function j(t,e){if(typeof e=="string"){if(t[e])return{value:t[e],key:e};{const n=Object.keys(t);for(const o of n){const[i,s]=o.split(":"),a=`${i}:${e}`,l=t[a];if(l)return{value:l,key:a}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const Re=()=>k.__FEDERATION__.moduleInfo,Ht=(t,e)=>{const r=ae(t),n=j(e,r).value;if(n&&!n.version&&"version"in t&&t.version&&(n.version=t.version),n)return n;if("version"in t&&t.version){const{version:o,...i}=t,s=ae(i),a=j(k.__FEDERATION__.moduleInfo,s).value;if(a?.version===o)return a}},se=t=>Ht(t,k.__FEDERATION__.moduleInfo),ke=(t,e)=>{const r=ae(t);return k.__FEDERATION__.moduleInfo[r]=e,k.__FEDERATION__.moduleInfo},Ve=t=>(k.__FEDERATION__.moduleInfo={...k.__FEDERATION__.moduleInfo,...t},()=>{const e=Object.keys(t);for(const r of e)delete k.__FEDERATION__.moduleInfo[r]}),Ne=(t,e)=>{const r=e||`__FEDERATION_${t}:custom__`,n=$[r];return{remoteEntryKey:r,entryExports:n}},Ct=t=>{const{__GLOBAL_PLUGIN__:e}=k.__FEDERATION__;t.forEach(r=>{e.findIndex(n=>n.name===r.name)===-1?e.push(r):he(`The plugin ${r.name} has been registered.`)})},xt=()=>k.__FEDERATION__.__GLOBAL_PLUGIN__,Gt=t=>$.__FEDERATION__.__PRELOADED_MAP__.get(t),Ut=t=>$.__FEDERATION__.__PRELOADED_MAP__.set(t,!0),de="default",Bt="global",Xe="[0-9A-Za-z-]+",We=`(?:\\+(${Xe}(?:\\.${Xe})*))`,ie="0|[1-9]\\d*",Se="[0-9]+",Vt="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Je=`(?:${Se}|${Vt})`,qr=`(?:-?(${Je}(?:\\.${Je})*))`,Ze=`(?:${ie}|${Vt})`,Wt=`(?:-(${Ze}(?:\\.${Ze})*))`,Te=`${ie}|x|X|\\*`,re=`[v=\\s]*(${Te})(?:\\.(${Te})(?:\\.(${Te})(?:${Wt})?${We}?)?)?`,zr=`^\\s*(${re})\\s+-\\s+(${re})\\s*$`,Yr=`(${Se})\\.(${Se})\\.(${Se})`,Xr=`[v=\\s]*${Yr}${qr}?${We}?`,je="((?:<|>)?=?)",Jr=`(\\s*)${je}\\s*(${Xr}|${re})`,jt="(?:~>?)",Zr=`(\\s*)${jt}\\s+`,Kt="(?:\\^)",Qr=`(\\s*)${Kt}\\s+`,en="(<|>)?=?\\s*\\*",tn=`^${Kt}${re}$`,rn=`(${ie})\\.(${ie})\\.(${ie})`,nn=`v?${rn}${Wt}?${We}?`,on=`^${jt}${re}$`,sn=`^${je}\\s*${re}$`,an=`^${je}\\s*(${nn})$|^$`,cn="^\\s*>=\\s*0.0.0\\s*$";function U(t){return new RegExp(t)}function P(t){return!t||t.toLowerCase()==="x"||t==="*"}function qt(...t){return e=>t.reduce((r,n)=>n(r),e)}function Qe(t){return t.match(U(an))}function et(t,e,r,n){const o=`${t}.${e}.${r}`;return n?`${o}-${n}`:o}function ln(t){return t.replace(U(zr),(e,r,n,o,i,s,a,l,c,u,d,f)=>(P(n)?r="":P(o)?r=`>=${n}.0.0`:P(i)?r=`>=${n}.${o}.0`:r=`>=${r}`,P(c)?l="":P(u)?l=`<${Number(c)+1}.0.0-0`:P(d)?l=`<${c}.${Number(u)+1}.0-0`:f?l=`<=${c}.${u}.${d}-${f}`:l=`<=${l}`,`${r} ${l}`.trim()))}function un(t){return t.replace(U(Jr),"$1$2$3")}function fn(t){return t.replace(U(Zr),"$1~")}function hn(t){return t.replace(U(Qr),"$1^")}function dn(t){return t.trim().split(/\s+/).map(e=>e.replace(U(tn),(r,n,o,i,s)=>P(n)?"":P(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:P(i)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:s?n==="0"?o==="0"?`>=${n}.${o}.${i}-${s} <${n}.${o}.${Number(i)+1}-0`:`>=${n}.${o}.${i}-${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${i}-${s} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${i} <${n}.${o}.${Number(i)+1}-0`:`>=${n}.${o}.${i} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${i} <${Number(n)+1}.0.0-0`)).join(" ")}function pn(t){return t.trim().split(/\s+/).map(e=>e.replace(U(on),(r,n,o,i,s)=>P(n)?"":P(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:P(i)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:s?`>=${n}.${o}.${i}-${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${i} <${n}.${Number(o)+1}.0-0`)).join(" ")}function mn(t){return t.split(/\s+/).map(e=>e.trim().replace(U(sn),(r,n,o,i,s,a)=>{const l=P(o),c=l||P(i),u=c||P(s);return n==="="&&u&&(n=""),a="",l?n===">"||n==="<"?"<0.0.0-0":"*":n&&u?(c&&(i=0),s=0,n===">"?(n=">=",c?(o=Number(o)+1,i=0,s=0):(i=Number(i)+1,s=0)):n==="<="&&(n="<",c?o=Number(o)+1:i=Number(i)+1),n==="<"&&(a="-0"),`${n+o}.${i}.${s}${a}`):c?`>=${o}.0.0${a} <${Number(o)+1}.0.0-0`:u?`>=${o}.${i}.0${a} <${o}.${Number(i)+1}.0-0`:r})).join(" ")}function En(t){return t.trim().replace(U(en),"")}function _n(t){return t.trim().replace(U(cn),"")}function be(t,e){return t=Number(t)||t,e=Number(e)||e,t>e?1:t===e?0:-1}function yn(t,e){const{preRelease:r}=t,{preRelease:n}=e;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,i=r.length;o<=i;o++){const s=r[o],a=n[o];if(s!==a)return s===void 0&&a===void 0?0:s?a?be(s,a):-1:1}return 0}function pe(t,e){return be(t.major,e.major)||be(t.minor,e.minor)||be(t.patch,e.patch)||yn(t,e)}function we(t,e){return t.version===e.version}function gn(t,e){switch(t.operator){case"":case"=":return we(t,e);case">":return pe(t,e)<0;case">=":return we(t,e)||pe(t,e)<0;case"<":return pe(t,e)>0;case"<=":return we(t,e)||pe(t,e)>0;case void 0:return!0;default:return!1}}function Sn(t){return qt(dn,pn,mn,En)(t)}function bn(t){return qt(ln,un,fn,hn)(t.trim()).split(/\s+/).join(" ")}function J(t,e){if(!t)return!1;const r=Qe(t);if(!r)return!1;const[,n,,o,i,s,a]=r,l={operator:n,version:et(o,i,s,a),major:o,minor:i,patch:s,preRelease:a?.split(".")},c=e.split("||");for(const u of c){const d=u.trim();if(!d||d==="*"||d==="x")return!0;try{const f=bn(d);if(!f.trim())return!0;const h=f.split(" ").map(_=>Sn(_)).join(" ");if(!h.trim())return!0;const E=h.split(/\s+/).map(_=>_n(_)).filter(Boolean);if(E.length===0)continue;let g=!0;for(const _ of E){const y=Qe(_);if(!y){g=!1;break}const[,p,,S,R,w,B]=y,O={operator:p,version:et(S,R,w,B),major:S,minor:R,patch:w,preRelease:B?.split(".")};if(!gn(O,l)){g=!1;break}}if(g)return!0}catch(f){console.error(`[semver] Error processing range part "${d}":`,f);continue}}return!1}function Rn(t,e,r,n){let o;if("get"in t?o=t.get:"lib"in t?o=()=>Promise.resolve(t.lib):o=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)}),t.shareConfig?.eager&&t.treeShaking?.mode)throw new Error('Can not set "eager:true" and "treeShaking" at the same time!');return{deps:[],useIn:[],from:e,loading:null,...t,shareConfig:{requiredVersion:`^${t.version}`,singleton:!1,eager:!1,strictVersion:!1,...t.shareConfig},get:o,loaded:t?.loaded||"lib"in t?!0:void 0,version:t.version??"0",scope:Array.isArray(t.scope)?t.scope:[t.scope??"default"],strategy:(t.strategy??n)||"version-first",treeShaking:t.treeShaking?{...t.treeShaking,mode:t.treeShaking.mode??"server-calc",status:t.treeShaking.status??1,useIn:[]}:void 0}}function zt(t,e){const r=e.shared||{},n=e.name,o=Object.keys(r).reduce((s,a)=>{const l=Pt(r[a]);return s[a]=s[a]||[],l.forEach(c=>{s[a].push(Rn(c,n,a,e.shareStrategy))}),s},{}),i={...t.shared};return Object.keys(o).forEach(s=>{i[s]?o[s].forEach(a=>{i[s].find(c=>c.version===a.version)||i[s].push(a)}):i[s]=o[s]}),{allShareInfos:i,newShareInfos:o}}function ce(t,e){if(!t)return!1;const{status:r,mode:n}=t;return r===0?!1:r===2?!0:n==="runtime-infer"?e?Nn(t,e):!0:!1}function q(t,e){const r=n=>{if(!Number.isNaN(Number(n))){const i=n.split(".");let s=n;for(let a=0;a<3-i.length;a++)s+=".0";return s}return n};return!!J(r(t),`<=${r(e)}`)}const le=(t,e)=>{const r=e||function(n,o){return q(n,o)};return Object.keys(t).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},Ie=t=>!!t.loaded||typeof t.lib=="function",In=t=>!!t.loading,Nn=(t,e)=>{if(!t||!e)return!1;const{usedExports:r}=t;return r?!!e.every(n=>r.includes(n)):!1};function $n(t,e,r,n){const o=t[e][r];let i="",s=ce(n);const a=function(l,c){return s?o[l].treeShaking?o[c].treeShaking?!Ie(o[l].treeShaking)&&q(l,c):!1:!0:!Ie(o[l])&&q(l,c)};if(s){if(i=le(t[e][r],a),i)return{version:i,useTreesShaking:s};s=!1}return{version:le(t[e][r],a),useTreesShaking:s}}const Y=t=>Ie(t)||In(t);function Tn(t,e,r,n){const o=t[e][r];let i="",s=ce(n);const a=function(l,c){if(s){if(!o[l].treeShaking)return!0;if(!o[c].treeShaking)return!1;if(Y(o[c].treeShaking))return Y(o[l].treeShaking)?!!q(l,c):!0;if(Y(o[l].treeShaking))return!1}return Y(o[c])?Y(o[l])?!!q(l,c):!0:Y(o[l])?!1:q(l,c)};if(s){if(i=le(t[e][r],a),i)return{version:i,useTreesShaking:s};s=!1}return{version:le(t[e][r],a),useTreesShaking:s}}function wn(t){return t==="loaded-first"?Tn:$n}function Q(t,e,r,n){if(!t)return;const{shareConfig:o,scope:i=de,strategy:s,treeShaking:a}=r,l=Array.isArray(i)?i:[i];for(const c of l)if(o&&t[c]&&t[c][e]){const{requiredVersion:u}=o,d=wn(s),{version:f,useTreesShaking:h}=d(t,c,e,a),E=()=>{const y=t[c][e][f];if(o.singleton){if(typeof u=="string"&&!J(f,u)){const p=`Version ${f} from ${f&&y.from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${u})`;o.strictVersion?G(p):he(p)}return{shared:y,useTreesShaking:h}}else{if(u===!1||u==="*")return{shared:y,useTreesShaking:h};if(J(f,u))return{shared:y,useTreesShaking:h};const p=ce(a);if(p){for(const[S,R]of Object.entries(t[c][e]))if(ce(R.treeShaking,a?.usedExports)&&J(S,u))return{shared:R,useTreesShaking:p}}for(const[S,R]of Object.entries(t[c][e]))if(J(S,u))return{shared:R,useTreesShaking:!1}}},g={shareScopeMap:t,scope:c,pkgName:e,version:f,GlobalFederation:z.__FEDERATION__,shareInfo:r,resolver:E};return(n.emit(g)||g).resolver()}}function Ke(){return z.__FEDERATION__.__SHARE__}function tt(t){const{pkgName:e,extraOptions:r,shareInfos:n}=t,o=l=>{if(!l)return;const c={};l.forEach(f=>{c[f.version]=f});const d=le(c,function(f,h){return!Ie(c[f])&&q(f,h)});return c[d]},i=r?.resolver??o,s=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),a=(...l)=>{const c={};for(const u of l)if(u)for(const[d,f]of Object.entries(u)){const h=c[d];s(h)&&s(f)?c[d]=a(h,f):f!==void 0&&(c[d]=f)}return c};return a(i(n[e]),r?.customShareInfo)}const X=(t,e)=>{t.useIn||(t.useIn=[]),Ur(t.useIn,e)};function me(t,e){return e&&t.treeShaking?t.treeShaking:t}function Mn(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function qe(t,e){for(const r of t){const n=e.startsWith(r.name);let o=e.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 i=r.alias&&e.startsWith(r.alias);let s=r.alias&&e.replace(r.alias,"");if(r.alias&&i){if(s&&s.startsWith("/")){const a=r.alias;return s=`.${s}`,{pkgNameOrAlias:a,expose:s,remote:r}}else if(s==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function On(t,e){for(const r of t)if(e===r.name||r.alias&&e===r.alias)return r}function Pn(t,e){const r=xt(),n=[e.hooks,e.remoteHandler.hooks,e.sharedHandler.hooks,e.snapshotHandler.hooks,e.loaderHook,e.bridgeHook];return r.length>0&&r.forEach(o=>{t?.find(i=>i.name!==o.name)&&t.push(o)}),t&&t.length>0&&t.forEach(o=>{n.forEach(i=>{i.applyPlugin(o,e)})}),t}const Yt=".then(callbacks[0]).catch(callbacks[1])";async function An({entry:t,remoteEntryExports:e}){return new Promise((r,n)=>{try{e?r(e):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${t}")${Yt}`)([r,n]):import(t).then(r).catch(n)}catch(o){n(o)}})}async function vn({entry:t,remoteEntryExports:e}){return new Promise((r,n)=>{try{e?r(e):typeof __system_context__>"u"?System.import(t).then(r).catch(n):new Function("callbacks",`System.import("${t}")${Yt}`)([r,n])}catch(o){n(o)}})}function Xt(t,e,r){const{remoteEntryKey:n,entryExports:o}=Ne(t,e);return A(o,I.getShortErrorMsg(I.RUNTIME_001,I.runtimeDescMap,{remoteName:t,remoteEntryUrl:r,remoteEntryKey:n})),o}async function kn({name:t,globalName:e,entry:r,loaderHook:n,getEntryUrl:o}){const{entryExports:i}=Ne(t,e);if(i)return i;const s=o?o(r):r;return b.loadScript(s,{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(()=>Xt(t,e,r)).catch(a=>{throw A(void 0,I.getShortErrorMsg(I.RUNTIME_008,I.runtimeDescMap,{remoteName:t,resourceUrl:r})),a})}async function Ln({remoteInfo:t,remoteEntryExports:e,loaderHook:r,getEntryUrl:n}){const{entry:o,entryGlobalName:i,name:s,type:a}=t;switch(a){case"esm":case"module":return An({entry:o,remoteEntryExports:e});case"system":return vn({entry:o,remoteEntryExports:e});default:return kn({entry:o,globalName:i,name:s,loaderHook:r,getEntryUrl:n})}}async function Fn({remoteInfo:t,loaderHook:e}){const{entry:r,entryGlobalName:n,name:o,type:i}=t,{entryExports:s}=Ne(o,n);return s||b.loadScriptNode(r,{attrs:{name:o,globalName:n,type:i},loaderHook:{createScriptHook:(a,l={})=>{const c=e.lifecycle.createScript.emit({url:a,attrs:l});if(c&&"url"in c)return c}}}).then(()=>Xt(o,n,r)).catch(a=>{throw a})}function Le(t){const{entry:e,name:r}=t;return b.composeKeyWithSeparator(r,e)}async function ue(t){const{origin:e,remoteEntryExports:r,remoteInfo:n,getEntryUrl:o,_inErrorHandling:i=!1}=t,s=Le(n);if(r)return r;if(!V[s]){const a=e.remoteHandler.hooks.lifecycle.loadEntry,l=e.loaderHook;V[s]=a.emit({loaderHook:l,remoteInfo:n,remoteEntryExports:r}).then(c=>c||(!0?Ln({remoteInfo:n,remoteEntryExports:r,loaderHook:l,getEntryUrl:o}):Fn({remoteInfo:n,loaderHook:l}))).catch(async c=>{const u=Le(n);if(c instanceof Error&&c.message.includes(I.RUNTIME_008)&&!i){const f=E=>ue({...E,_inErrorHandling:!0}),h=await e.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:f,origin:e,remoteInfo:n,remoteEntryExports:r,globalLoading:V,uniqueKey:u});if(h)return h}throw c})}return V[s]}function fe(t){return{...t,entry:"entry"in t?t.entry:"",type:t.type||Bt,entryGlobalName:t.entryGlobalName||t.name,shareScope:t.shareScope||de}}function Jt(t){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...t}}function Dn(t,e){return e.map(r=>{const n=On(t,r.nameOrAlias);return A(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&b.safeToString({remoteInfo:n,remotes:t})}`),{remote:n,preloadConfig:Jt(r)}})}function Hn(t){return t?t.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function ze(t,e,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:i,entryAssets:s}=r;if(e.options.inBrowser){if(s.forEach(a=>{const{moduleInfo:l}=a,c=e.moduleCache.get(t.name);ue(c?{origin:e,remoteInfo:l,remoteEntryExports:c.remoteEntryExports}:{origin:e,remoteInfo:l,remoteEntryExports:void 0})}),n){const a={rel:"preload",as:"style"};o.forEach(l=>{const{link:c,needAttach:u}=b.createLink({url:l,cb:()=>{},attrs:a,createLinkHook:(d,f)=>{const h=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(h instanceof HTMLLinkElement)return h}});u&&document.head.appendChild(c)})}else{const a={rel:"stylesheet",type:"text/css"};o.forEach(l=>{const{link:c,needAttach:u}=b.createLink({url:l,cb:()=>{},attrs:a,createLinkHook:(d,f)=>{const h=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(h instanceof HTMLLinkElement)return h},needDeleteLink:!1});u&&document.head.appendChild(c)})}if(n){const a={rel:"preload",as:"script"};i.forEach(l=>{const{link:c,needAttach:u}=b.createLink({url:l,cb:()=>{},attrs:a,createLinkHook:(d,f)=>{const h=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(h instanceof HTMLLinkElement)return h}});u&&document.head.appendChild(c)})}else{const a={fetchpriority:"high",type:t?.type==="module"?"module":"text/javascript"};i.forEach(l=>{const{script:c,needAttach:u}=b.createScript({url:l,cb:()=>{},attrs:a,createScriptHook:(d,f)=>{const h=e.loaderHook.lifecycle.createScript.emit({url:d,attrs:f});if(h instanceof HTMLScriptElement)return h},needDeleteScript:!0});u&&document.head.appendChild(c)})}}}const Cn={getRegisteredShare:Q,getGlobalShareScope:Ke},xn={Global:z,nativeGlobal:k,resetFederationGlobalInfo:kt,setGlobalFederationInstance:Lt,getGlobalFederationConstructor:Ft,setGlobalFederationConstructor:Dt,getInfoWithoutType:j,getGlobalSnapshot:Re,getTargetSnapshotInfoByModuleInfo:Ht,getGlobalSnapshotInfoByModuleInfo:se,setGlobalSnapshotInfoByModuleInfo:ke,addGlobalSnapshot:Ve,getRemoteEntryExports:Ne,registerGlobalPlugins:Ct,getGlobalHostPlugins:xt,getPreloaded:Gt,setPreloaded:Ut};var Gn={global:xn,share:Cn,utils:{matchRemoteWithNameAndExpose:qe,preloadAssets:ze,getRemoteInfo:fe}};function Un(t,e){const r=e,n=Array.isArray(t.shareScope)?t.shareScope:[t.shareScope];n.length||n.push("default"),n.forEach(a=>{r[a]||(r[a]={})});const o={version:t.version||"",shareScopeKeys:Array.isArray(t.shareScope)?n:t.shareScope||"default"};Object.defineProperty(o,"shareScopeMap",{value:r,enumerable:!1});const i=r[n[0]];return{remoteEntryInitOptions:o,shareScope:i,initScope:[]}}class Ye{constructor({remoteInfo:e,host:r}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=r}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await ue({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return A(e,`remoteEntryExports is undefined
|
|
7
|
+
${b.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,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:i,initScope:s}=Un(this.remoteInfo,this.host.shareScopeMap),a=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:i,remoteEntryInitOptions:o,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});typeof n?.init>"u"&&G(I.getShortErrorMsg(I.RUNTIME_002,I.runtimeDescMap,{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:r,remoteEntryExports:n}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return n}async get(e,r,n,o){const{loadFactory:i=!0}=n||{loadFactory:!0},s=await this.init(e,o);this.lib=s;let a;a=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:r,moduleInfo:this.remoteInfo}),a||(a=await s.get(r)),A(a,`${ae(this.remoteInfo)} remote don't export ${r}.`);const l=Kr(this.remoteInfo.name,r),c=this.wraperFactory(a,l);return i?await c():c}wraperFactory(e,r){function n(o,i){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:i,enumerable:!1})}return e instanceof Promise?async()=>{const o=await e();return n(o,r),o}:()=>{const o=e();return n(o,r),o}}}class F{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const r=this;this.on(function n(...o){return r.remove(n),e.apply(null,o)})}emit(...e){let r;return this.listeners.size>0&&this.listeners.forEach(n=>{r=n(...e)}),r}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}}class C extends F{emit(...e){let r;const n=Array.from(this.listeners);if(n.length>0){let o=0;const i=s=>s===!1?!1:o<n.length?Promise.resolve(n[o++].apply(null,e)).then(i):s;r=i()}return Promise.resolve(r)}}function Zt(t,e){if(!Be(e))return!1;if(t!==e){for(const r in t)if(!(r in e))return!1}return!0}class ee extends F{constructor(e){super(),this.onerror=G,this.type=e}emit(e){Be(e)||G(`The data for the "${this.type}" hook should be an object.`);for(const r of this.listeners)try{const n=r(e);if(Zt(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){he(n),this.onerror(n)}return e}}class W extends F{constructor(e){super(),this.onerror=G,this.type=e}emit(e){Be(e)||G(`The response data for the "${this.type}" hook must be an object.`);const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>(he(s),this.onerror(s),e),i=s=>{if(Zt(e,s)){if(e=s,n<r.length)try{return Promise.resolve(r[n++](e)).then(i,o)}catch(a){return o(a)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(i(e))}return Promise.resolve(e)}}class te{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,r){A(Wr(e),"Plugin configuration is invalid.");const n=e.name;A(n,"A name must be provided by the plugin."),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply?.(r),Object.keys(this.lifecycle).forEach(o=>{const i=e[o];i&&this.lifecycle[o].on(i)}))}removePlugin(e){A(e,"A name is required.");const r=this.registerPlugins[e];A(r,`The plugin "${e}" is not registered.`),Object.keys(r).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(r[n])})}}function Qt(t,e){const r=At(e);r.url||G(`The attribute remoteEntry of ${t.name} must not be undefined.`);let n=b.getResourceUrl(e,r.url);!b.isBrowserEnv()&&!n.startsWith("http")&&(n=`https:${n}`),t.type=r.type,t.entryGlobalName=r.globalName,t.entry=n,t.version=e.version,t.buildVersion=e.buildVersion}function Bn(){return{name:"snapshot-plugin",async afterResolve(t){const{remote:e,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:i,id:s}=t;if(!Ue(e)||!Ot(e)){const{remoteSnapshot:a,globalSnapshot:l}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:e,id:s});Qt(i,a);const c={remote:e,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},u=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:c,remoteInfo:i,remote:e,remoteSnapshot:a,globalSnapshot:l});return u&&ze(i,o,u,!1),{...t,remoteSnapshot:a}}return t}}}function Vn(t){const e=t.split(":");return e.length===1?{name:e[0],version:void 0}:e.length===2?{name:e[0],version:e[1]}:{name:e[1],version:e[2]}}function er(t,e,r,n,o={},i){const s=ae(e),{value:a}=j(t,s),l=i||a;if(l&&!b.isManifestProvider(l)&&(r(l,e,n),l.remotesInfo)){const c=Object.keys(l.remotesInfo);for(const u of c){if(o[u])continue;o[u]=!0;const d=Vn(u),f=l.remotesInfo[u];er(t,{name:d.name,version:f.matchedVersion},r,!1,o,void 0)}}}const Me=(t,e)=>document.querySelector(`${t}[${t==="link"?"href":"src"}="${e}"]`);function Wn(t,e,r,n,o){const i=[],s=[],a=[],l=new Set,c=new Set,{options:u}=t,{preloadConfig:d}=e,{depsRemote:f}=d;if(er(n,r,(_,y,p)=>{let S;if(p)S=d;else if(Array.isArray(f)){const H=f.find(L=>L.nameOrAlias===y.name||L.nameOrAlias===y.alias);if(!H)return;S=Jt(H)}else if(f===!0)S=d;else return;const R=b.getResourceUrl(_,At(_).url);R&&a.push({name:y.name,moduleInfo:{name:y.name,entry:R,type:"remoteEntryType"in _?_.remoteEntryType:"global",entryGlobalName:"globalName"in _?_.globalName:y.name,shareScope:"",version:"version"in _?_.version:void 0},url:R});let w="modules"in _?_.modules:[];const B=Hn(S.exposes);B.length&&"modules"in _&&(w=_?.modules?.reduce((H,L)=>(B?.indexOf(L.moduleName)!==-1&&H.push(L),H),[]));function O(H){const L=H.map(x=>b.getResourceUrl(_,x));return S.filter?L.filter(S.filter):L}if(w){const H=w.length;for(let L=0;L<H;L++){const x=w[L],$e=`${y.name}/${x.moduleName}`;t.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:x.moduleName==="."?y.name:$e,name:y.name,remoteSnapshot:_,preloadConfig:S,remote:y,origin:t}),!Gt($e)&&(S.resourceCategory==="all"?(i.push(...O(x.assets.css.async)),i.push(...O(x.assets.css.sync)),s.push(...O(x.assets.js.async)),s.push(...O(x.assets.js.sync))):(S.resourceCategory="sync")&&(i.push(...O(x.assets.css.sync)),s.push(...O(x.assets.js.sync))),Ut($e))}}},!0,{},o),o.shared&&o.shared.length>0){const _=(y,p)=>{const{shared:S}=Q(t.shareScopeMap,p.sharedName,y,t.sharedHandler.hooks.lifecycle.resolveShare)||{};S&&typeof S.lib=="function"&&(p.assets.js.sync.forEach(R=>{l.add(R)}),p.assets.css.sync.forEach(R=>{c.add(R)}))};o.shared.forEach(y=>{const p=u.shared?.[y.sharedName];if(!p)return;const S=y.version?p.find(w=>w.version===y.version):p;if(!S)return;Pt(S).forEach(w=>{_(w,y)})})}const E=s.filter(_=>!l.has(_)&&!Me("script",_));return{cssAssets:i.filter(_=>!c.has(_)&&!Me("link",_)),jsAssetsWithoutEntry:E,entryAssets:a.filter(_=>!Me("script",_.url))}}const jn=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(t){const{origin:e,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:i,remoteSnapshot:s}=t;return b.isBrowserEnv()?Ue(o)&&Ot(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(Qt(n,s),Wn(e,r,n,i,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function tr(t,e){const r=se({name:e.name,version:e.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&j(r.remotesInfo,t.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:Re(),remoteSnapshot:se({name:t.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Re(),remoteSnapshot:se({name:t.name,version:"version"in t?t.version:void 0})}}class Kn{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new te({beforeLoadRemoteSnapshot:new C("beforeLoadRemoteSnapshot"),loadSnapshot:new W("loadGlobalSnapshot"),loadRemoteSnapshot:new W("loadRemoteSnapshot"),afterLoadSnapshot:new W("afterLoadSnapshot")}),this.manifestLoading=z.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:r,expose:n}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e});let i=se({name:this.HostInstance.options.name,version:this.HostInstance.options.version});i||(i={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Ve({[this.HostInstance.options.name]:i})),i&&"remotesInfo"in i&&!j(i.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(i.remotesInfo={...i?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:a,globalSnapshot:l}=this.getGlobalRemoteInfo(e),{remoteSnapshot:c,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:a,globalSnapshot:l});let d,f;if(c)if(b.isManifestProvider(c)){const h=b.isBrowserEnv()?c.remoteEntry:c.ssrRemoteEntry||c.remoteEntry||"",E=await this.getManifestJson(h,e,{}),g=ke({...e,entry:h},E);d=E,f=g}else{const{remoteSnapshot:h}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:c,from:"global"});d=h,f=u}else if(Ue(e)){const h=await this.getManifestJson(e.entry,e,{}),E=ke(e,h),{remoteSnapshot:g}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});d=g,f=E}else G(I.getShortErrorMsg(I.RUNTIME_007,I.runtimeDescMap,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(u)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:r,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:d}),{remoteSnapshot:d,globalSnapshot:f}}getGlobalRemoteInfo(e){return tr(e,this.HostInstance)}async getManifestJson(e,r,n){const o=async()=>{let s=this.manifestCache.get(e);if(s)return s;try{let a=await this.loaderHook.lifecycle.fetch.emit(e,{});(!a||!(a instanceof Response))&&(a=await fetch(e,{})),s=await a.json()}catch(a){s=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:a,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),s||(delete this.manifestLoading[e],G(I.getShortErrorMsg(I.RUNTIME_003,I.runtimeDescMap,{manifestUrl:e,moduleName:r.name,hostName:this.HostInstance.options.name},`${a}`)))}return A(s.metaData&&s.exposes&&s.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,s),s},i=async()=>{const s=await o(),a=b.generateSnapshotFromManifest(s,{version:e}),{remoteSnapshot:l}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:r,manifestJson:s,remoteSnapshot:a,manifestUrl:e,from:"manifest"});return l};return this.manifestLoading[e]||(this.manifestLoading[e]=i().then(s=>s)),this.manifestLoading[e]}}class qn{constructor(e){this.hooks=new te({beforeRegisterShare:new ee("beforeRegisterShare"),afterResolve:new W("afterResolve"),beforeLoadShare:new W("beforeLoadShare"),loadShare:new C,resolveShare:new ee("resolveShare"),initContainerShareScopeMap:new ee("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,r){const{newShareInfos:n,allShareInfos:o}=zt(e,r);return Object.keys(n).forEach(s=>{n[s].forEach(l=>{l.scope.forEach(c=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:s,shared:l}),this.shareScopeMap[c]?.[s]||this.setShared({pkgName:s,lib:l.lib,get:l.get,loaded:l.loaded||!!l.lib,shared:l,from:r.name})})})}),{newShareInfos:n,allShareInfos:o}}async loadShare(e,r){const{host:n}=this,o=tt({pkgName:e,extraOptions:r,shareInfos:n.options.shared});o?.scope&&await Promise.all(o.scope.map(async c=>{await Promise.all(this.initializeSharing(c,{strategy:o.strategy}))}));const i=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:o,shared:n.options.shared,origin:n}),{shareInfo:s}=i;A(s,`Cannot find ${e} Share in the ${n.options.name}. Please ensure that the ${e} Share parameters have been injected`);const{shared:a,useTreesShaking:l}=Q(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(a){const c=me(a,l);if(c.lib)return X(c,n.options.name),c.lib;if(c.loading&&!c.loaded){const u=await c.loading;return c.loaded=!0,c.lib||(c.lib=u),X(c,n.options.name),u}else{const d=(async()=>{const f=await c.get();return X(c,n.options.name),c.loaded=!0,c.lib=f,f})();return this.setShared({pkgName:e,loaded:!1,shared:a,from:n.options.name,lib:null,loading:d,treeShaking:l?c:void 0}),d}}else{if(r?.customShareInfo)return!1;const c=ce(s.treeShaking),u=me(s,c),f=(async()=>{const h=await u.get();u.lib=h,u.loaded=!0,X(u,n.options.name);const{shared:E,useTreesShaking:g}=Q(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(E){const _=me(E,g);_.lib=h,_.loaded=!0,E.from=s.from}return h})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:f,treeShaking:c?u:void 0}),f}}initializeSharing(e=de,r){const{host:n}=this,o=r?.from,i=r?.strategy;let s=r?.initScope;const a=[];if(o!=="build"){const{initTokens:h}=this;s||(s=[]);let E=h[e];if(E||(E=h[e]={from:this.host.name}),s.indexOf(E)>=0)return a;s.push(E)}const l=this.shareScopeMap,c=n.options.name;l[e]||(l[e]={});const u=l[e],d=(h,E)=>{const{version:g,eager:_}=E;u[h]=u[h]||{};const y=u[h],p=y[g]&&me(y[g]),S=!!(p&&("eager"in p&&p.eager||"shareConfig"in p&&p.shareConfig?.eager));(!p||p.strategy!=="loaded-first"&&!p.loaded&&(!_!=!S?_:c>y[g].from))&&(y[g]=E)},f=async h=>{const{module:E}=await n.remoteHandler.getRemoteModuleAndOptions({id:h});let g;try{g=await E.getEntry()}catch(_){g=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:h,error:_,from:"runtime",lifecycle:"beforeLoadShare",origin:n})}finally{g?.init&&(E.remoteEntryExports=g,await E.init())}};return Object.keys(n.options.shared).forEach(h=>{n.options.shared[h].forEach(g=>{g.scope.includes(e)&&d(h,g)})}),(n.options.shareStrategy==="version-first"||i==="version-first")&&n.options.remotes.forEach(h=>{h.shareScope===e&&a.push(f(h.name))}),a}loadShareSync(e,r){const{host:n}=this,o=tt({pkgName:e,extraOptions:r,shareInfos:n.options.shared});o?.scope&&o.scope.forEach(a=>{this.initializeSharing(a,{strategy:o.strategy})});const{shared:i,useTreesShaking:s}=Q(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(i){if(typeof i.lib=="function")return X(i,n.options.name),i.loaded||(i.loaded=!0,i.from===n.options.name&&(o.loaded=!0)),i.lib;if(typeof i.get=="function"){const a=i.get();if(!(a instanceof Promise))return X(i,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:a,shared:i}),a}}if(o.lib)return o.loaded||(o.loaded=!0),o.lib;if(o.get){const a=o.get();if(a instanceof Promise){const l=r?.from==="build"?I.RUNTIME_005:I.RUNTIME_006;throw new Error(I.getShortErrorMsg(l,I.runtimeDescMap,{hostName:n.options.name,sharedPkgName:e}))}return o.lib=a,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:o.lib,shared:o}),o.lib}throw new Error(I.getShortErrorMsg(I.RUNTIME_006,I.runtimeDescMap,{hostName:n.options.name,sharedPkgName:e}))}initShareScopeMap(e,r,n={}){const{host:o}=this;this.shareScopeMap[e]=r,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:r,options:o.options,origin:o,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:r,from:n,lib:o,loading:i,loaded:s,get:a,treeShaking:l}){const{version:c,scope:u="default",...d}=r,f=Array.isArray(u)?u:[u],h=E=>{const g=(y,p,S)=>{S&&!y[p]&&(y[p]=S)},_=l?E.treeShaking:E;g(_,"loaded",s),g(_,"loading",i),g(_,"get",a)};f.forEach(E=>{this.shareScopeMap[E]||(this.shareScopeMap[E]={}),this.shareScopeMap[E][e]||(this.shareScopeMap[E][e]={}),this.shareScopeMap[E][e][c]||(this.shareScopeMap[E][e][c]={version:c,scope:[E],...d,lib:o});const g=this.shareScopeMap[E][e][c];h(g),n&&g.from!==n&&(g.from=n)})}_setGlobalShareScopeMap(e){const r=Ke(),n=e.id||e.name;n&&!r[n]&&(r[n]=this.shareScopeMap)}}class zn{constructor(e){this.hooks=new te({beforeRegisterRemote:new ee("beforeRegisterRemote"),registerRemote:new ee("registerRemote"),beforeRequest:new W("beforeRequest"),onLoad:new C("onLoad"),handlePreloadModule:new F("handlePreloadModule"),errorLoadRemote:new C("errorLoadRemote"),beforePreloadRemote:new C("beforePreloadRemote"),generatePreloadAssets:new C("generatePreloadAssets"),afterPreloadRemote:new C,loadEntry:new C}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,r){return(r.remotes||[]).reduce((o,i)=>(this.registerRemote(i,o,{force:!1}),o),e.remotes)}setIdToRemoteMap(e,r){const{remote:n,expose:o}=r,{name:i,alias:s}=n;if(this.idToRemoteMap[e]={name:n.name,expose:o},s&&e.startsWith(i)){const a=e.replace(i,s);this.idToRemoteMap[a]={name:n.name,expose:o};return}if(s&&e.startsWith(s)){const a=e.replace(s,i);this.idToRemoteMap[a]={name:n.name,expose:o}}}async loadRemote(e,r){const{host:n}=this;try{const{loadFactory:o=!0}=r||{loadFactory:!0},{module:i,moduleOptions:s,remoteMatchInfo:a}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:l,remote:c,expose:u,id:d,remoteSnapshot:f}=a,h=await i.get(d,u,r,f),E=await this.hooks.lifecycle.onLoad.emit({id:d,pkgNameOrAlias:l,expose:u,exposeModule:o?h:void 0,exposeModuleFactory:o?void 0:h,remote:c,options:s,moduleInstance:i,origin:n});return this.setIdToRemoteMap(e,a),typeof E=="function"?E:h}catch(o){const{from:i="runtime"}=r||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:o,from:i,lifecycle:"onLoad",origin:n});if(!s)throw o;return s}}async preloadRemote(e){const{host:r}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:r.options,origin:r});const n=Dn(r.options.remotes,e);await Promise.all(n.map(async o=>{const{remote:i}=o,s=fe(i),{globalSnapshot:a,remoteSnapshot:l}=await r.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:i}),c=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:r,preloadOptions:o,remote:i,remoteInfo:s,globalSnapshot:a,remoteSnapshot:l});c&&ze(s,r,c)}))}registerRemotes(e,r){const{host:n}=this;e.forEach(o=>{this.registerRemote(o,n.options.remotes,{force:r?.force})})}async getRemoteModuleAndOptions(e){const{host:r}=this,{id:n}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:r.options,origin:r})}catch(E){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:r.options,origin:r,from:"runtime",error:E,lifecycle:"beforeRequest"}),!o)throw E}const{id:i}=o,s=qe(r.options.remotes,i);A(s,I.getShortErrorMsg(I.RUNTIME_004,I.runtimeDescMap,{hostName:r.options.name,requestId:i}));const{remote:a}=s,l=fe(a),c=await r.sharedHandler.hooks.lifecycle.afterResolve.emit({id:i,...s,options:r.options,origin:r,remoteInfo:l}),{remote:u,expose:d}=c;A(u&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${i}.`);let f=r.moduleCache.get(u.name);const h={host:r,remoteInfo:l};return f||(f=new Ye(h),r.moduleCache.set(u.name,f)),{module:f,moduleOptions:h,remoteMatchInfo:c}}registerRemote(e,r,n){const{host:o}=this,i=()=>{if(e.alias){const a=r.find(l=>e.alias&&(l.name.startsWith(e.alias)||l.alias?.startsWith(e.alias)));A(!a,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${a&&a.name} name or alias`)}"entry"in e&&b.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=de),e.type||(e.type=Bt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const s=r.find(a=>a.name===e.name);if(!s)i(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const a=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];n?.force&&(this.removeRemote(s),i(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),b.warn(a.join(" ")))}}removeRemote(e){try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(s=>s.name===n);o!==-1&&r.options.remotes.splice(o,1);const i=r.moduleCache.get(e.name);if(i){const s=i.remoteInfo,a=s.entryGlobalName;$[a]&&(Object.getOwnPropertyDescriptor($,a)?.configurable?delete $[a]:$[a]=void 0);const l=Le(i.remoteInfo);V[l]&&delete V[l],r.snapshotHandler.manifestCache.delete(s.entry);let c=s.buildVersion?b.composeKeyWithSeparator(s.name,s.buildVersion):s.name;const u=$.__FEDERATION__.__INSTANCES__.findIndex(f=>s.buildVersion?f.options.id===c:f.name===c);if(u!==-1){const f=$.__FEDERATION__.__INSTANCES__[u];c=f.options.id||c;const h=Ke();let E=!0;const g=[];Object.keys(h).forEach(_=>{const y=h[_];y&&Object.keys(y).forEach(p=>{const S=y[p];S&&Object.keys(S).forEach(R=>{const w=S[R];w&&Object.keys(w).forEach(B=>{const O=w[B];O&&typeof O=="object"&&O.from===s.name&&(O.loaded||O.loading?(O.useIn=O.useIn.filter(H=>H!==s.name),O.useIn.length?E=!1:g.push([_,p,R,B])):g.push([_,p,R,B]))})})})}),E&&(f.shareScopeMap={},delete h[c]),g.forEach(([_,y,p,S])=>{delete h[_]?.[y]?.[p]?.[S]}),$.__FEDERATION__.__INSTANCES__.splice(u,1)}const{hostGlobalSnapshot:d}=tr(e,r);if(d){const f=d&&"remotesInfo"in d&&d.remotesInfo&&j(d.remotesInfo,e.name).key;f&&(delete d.remotesInfo[f],z.__FEDERATION__.__MANIFEST_LOADING__[f]&&delete z.__FEDERATION__.__MANIFEST_LOADING__[f])}r.moduleCache.delete(e.name)}}catch(r){ve.log("removeRemote fail: ",r)}}}const Yn=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;class Xn{constructor(e){this.hooks=new te({beforeInit:new ee("beforeInit"),init:new F,beforeInitContainer:new W("beforeInitContainer"),initContainer:new W("initContainer")}),this.version="2.0.1",this.moduleCache=new Map,this.loaderHook=new te({getModuleInfo:new F,createScript:new F,createLink:new F,fetch:new C,loadEntryError:new C,getModuleFactory:new C}),this.bridgeHook=new te({beforeBridgeRender:new F,afterBridgeRender:new F,beforeBridgeDestroy:new F,afterBridgeDestroy:new F});const r=Yn?[Bn(),jn()]:[],n={id:Mn(),name:e.name,plugins:r,remotes:[],shared:{},inBrowser:b.isBrowserEnv()};this.name=e.name,this.options=n,this.snapshotHandler=new Kn(this),this.sharedHandler=new qn(this),this.remoteHandler=new zn(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){this.registerPlugins(e.plugins);const r=this.formatOptions(this.options,e);return this.options=r,r}async loadShare(e,r){return this.sharedHandler.loadShare(e,r)}loadShareSync(e,r){return this.sharedHandler.loadShareSync(e,r)}initializeSharing(e=de,r){return this.sharedHandler.initializeSharing(e,r)}initRawContainer(e,r,n){const o=fe({name:e,entry:r}),i=new Ye({host:this,remoteInfo:o});return i.remoteEntryExports=n,this.moduleCache.set(e,i),i}async loadRemote(e,r){return this.remoteHandler.loadRemote(e,r)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,r,n={}){this.sharedHandler.initShareScopeMap(e,r,n)}formatOptions(e,r){const{allShareInfos:n}=zt(e,r),{userOptions:o,options:i}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:r,options:e,shareInfo:n}),s=this.remoteHandler.formatAndRegisterRemote(i,o),{allShareInfos:a}=this.sharedHandler.registerShared(i,o),l=[...i.plugins];o.plugins&&o.plugins.forEach(u=>{l.includes(u)||l.push(u)});const c={...e,...r,plugins:l,remotes:s,shared:a};return this.hooks.lifecycle.init.emit({origin:this,options:c}),c}registerPlugins(e){const r=Pn(e,this);this.options.plugins=this.options.plugins.reduce((n,o)=>(o&&n&&!n.find(i=>i.name===o.name)&&n.push(o),n),r||[])}registerRemotes(e,r){return this.remoteHandler.registerRemotes(e,r)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}}var Jn=Object.freeze({__proto__:null});N.loadScript=b.loadScript;N.loadScriptNode=b.loadScriptNode;N.CurrentGlobal=$;N.Global=z;N.Module=Ye;N.ModuleFederation=Xn;N.addGlobalSnapshot=Ve;N.assert=A;N.getGlobalFederationConstructor=Ft;N.getGlobalSnapshot=Re;N.getInfoWithoutType=j;N.getRegisteredShare=Q;N.getRemoteEntry=ue;N.getRemoteInfo=fe;N.helpers=Gn;N.isStaticResourcesEqual=jr;N.matchRemoteWithNameAndExpose=qe;N.registerGlobalPlugins=Ct;N.resetFederationGlobalInfo=kt;N.safeWrapper=Br;N.satisfy=J;N.setGlobalFederationConstructor=Dt;N.setGlobalFederationInstance=Lt;N.types=Jn;var rr={},Zn=N;function Qn(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function eo(t,e){const r=Qn();return Zn.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!(r&&n.options.id===r||n.options.name===t&&!n.options.version&&!e||n.options.name===t&&e&&n.options.version===e))}rr.getGlobalFederationInstance=eo;var D=N,to=rr;function ro(t){const e=D.getGlobalFederationConstructor()||D.ModuleFederation,r=new e(t);return D.setGlobalFederationInstance(r),r}let Ee=null;function no(t){const e=to.getGlobalFederationInstance(t.name,t.version);return e?(e.initOptions(t),Ee||(Ee=e),e):(Ee=ro(t),Ee)}D.setGlobalFederationConstructor(D.ModuleFederation);D.Module;D.ModuleFederation;D.getRemoteEntry;D.getRemoteInfo;D.loadScript;D.loadScriptNode;D.registerGlobalPlugins;var so=no;export{so as i};
|
|
8
|
+
//# sourceMappingURL=index.cjs-qNTcCtpj.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e="__mf_init____mf__virtual/adminUI__mf_v__runtimeInit__mf_v__.js__";if(!globalThis[e]){let i,n;const o=new Promise((t,_)=>{i=t,n=_});globalThis[e]={initPromise:o,initResolve:i,initReject:n},typeof window>"u"&&i({loadRemote:function(){return Promise.resolve(void 0)},loadShare:function(){return Promise.resolve(void 0)}})}const{initPromise:s,initResolve:l,initReject:r}=globalThis[e];export{l as a,s as i};
|
|
2
|
+
//# sourceMappingURL=runtimeInit-DE95pSy4.js.map
|
package/public/index.html
CHANGED
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
<link rel="shortcut icon" href="img/favicon.ico" />
|
|
17
17
|
<title>Signal K Server</title>
|
|
18
|
-
<script type="module" crossorigin src="./assets/index-
|
|
18
|
+
<script type="module" crossorigin src="./assets/index-CLC5Par7.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-Ct5FWWRu.js">
|
|
20
|
-
<link rel="modulepreload" crossorigin href="./assets/
|
|
20
|
+
<link rel="modulepreload" crossorigin href="./assets/index.cjs-qNTcCtpj.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="./assets/runtimeInit-DE95pSy4.js">
|
|
21
22
|
<link rel="stylesheet" crossorigin href="./assets/style-CzSZ78W4.css">
|
|
22
23
|
</head>
|
|
23
24
|
<body
|
package/public/remoteEntry.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-
|
|
2
|
-
import{i as l
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-BEQk0SN_.js","./assets/adminUI__loadShare__react__loadShare__.mjs_commonjs-proxy-ByXi4yJ8.js","./assets/adminUI__loadShare__react__loadShare__.mjs-D8asHvWX.js","./assets/runtimeInit-DE95pSy4.js","./assets/index-LtR7LJbL.js","./assets/index-C0euSWDO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as l}from"./assets/index.cjs-qNTcCtpj.js";import a from"./assets/virtualExposes-BIHI7g3E.js";import{_ as i}from"./assets/preload-helper-Ct5FWWRu.js";import{a as f}from"./assets/runtimeInit-DE95pSy4.js";const s={react:async()=>await i(()=>import("./assets/index-BEQk0SN_.js").then(t=>t.i),__vite__mapDeps([0,1,2,3,4]),import.meta.url),"react-dom":async()=>await i(()=>import("./assets/index-C0euSWDO.js").then(t=>t.i),__vite__mapDeps([5,1,2,3,4]),import.meta.url)},n={react:{name:"react",version:"16.14.0",scope:["default"],loaded:!1,from:"adminUI",async get(){n.react.loaded=!0;const{react:e}=s,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"^16.14.0"}},"react-dom":{name:"react-dom",version:"16.14.0",scope:["default"],loaded:!1,from:"adminUI",async get(){n["react-dom"].loaded=!0;const{"react-dom":e}=s,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"^16.14.0"}}},p=[],c={},u="default",d="adminUI";async function v(e={},t=[]){const r=l({name:d,remotes:p,shared:n,plugins:[],shareStrategy:"version-first"});var o=c[u];if(o||(o=c[u]={from:d}),!(t.indexOf(o)>=0)){t.push(o),r.initShareScopeMap("default",e);try{await Promise.all(await r.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(m){console.error(m)}return f(r),r}}function k(e){if(!(e in a))throw new Error(`Module ${e} does not exist in container.`);return a[e]().then(t=>()=>t)}export{k as get,v as init};
|
|
3
3
|
//# sourceMappingURL=remoteEntry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var r=e.default;if(typeof r=="function"){var t=function o(){return this instanceof o?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t}export{l as a,u as c,f as g};
|
|
2
|
-
//# sourceMappingURL=_commonjsHelpers-D6-XlEtG.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./_commonjsHelpers-D6-XlEtG.js";import{b as c}from"./adminUI__mf_v__runtimeInit__mf_v__-OBqvctZP.js";function f(e,s){for(var a=0;a<s.length;a++){const t=s[a];if(typeof t!="string"&&!Array.isArray(t)){for(const r in t)if(r!=="default"&&!(r in e)){const n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const l=c.then(e=>e.loadShare("react",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"^16.14.0"}}})),o=await l.then(e=>e()),u=o,_=o.__esModule?o.default:o,d=f({__proto__:null,default:_},[u]),g=i(d);export{_ as R,u as _,g as r};
|
|
2
|
-
//# sourceMappingURL=adminUI__loadShare__react__loadShare__-BXV3lg18.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var I={},m={},Q={};const tr="federation-manifest.json",Pe=".json",et="FEDERATION_DEBUG",T={AT:"@",HYPHEN:"-",SLASH:"/"},v={[T.AT]:"scope_",[T.HYPHEN]:"_",[T.SLASH]:"__"},de={[v[T.AT]]:T.AT,[v[T.HYPHEN]]:T.HYPHEN,[v[T.SLASH]]:T.SLASH},Oe=":",Ie="mf-manifest.json",Ne="mf-stats.json",rr={NPM:"npm",APP:"app"},nr="__MF_DEVTOOLS_MODULE_INFO__",or="ENCODE_NAME_PREFIX",sr=".federation",ir={identifier:"MFDataPrefetch",globalKey:"__PREFETCH__",library:"mf-data-prefetch",exportsKey:"__PREFETCH_EXPORTS__",fileName:"bootstrap.js"};var ar=Object.freeze({__proto__:null}),cr=Object.freeze({__proto__:null}),lr=Object.freeze({__proto__:null}),ur=Object.freeze({__proto__:null});function ve(){return typeof window<"u"&&typeof window.document<"u"}function tt(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function fr(){try{if(ve()&&window.localStorage)return!!localStorage.getItem(et)}catch{return!1}return!1}function $e(){return typeof process<"u"&&Q&&Q.FEDERATION_DEBUG?!!Q.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:fr()}const rt=function(){return typeof process<"u"&&Q?Q:{}},nt="[ Federation Runtime ]",dr=(t,e,r=Oe)=>{const n=t.split(r),o=rt().NODE_ENV==="development"&&e,a="*",s=i=>i.startsWith("http")||i.includes(Pe);if(n.length>=2){let[i,...c]=n;t.startsWith(r)&&(i=n.slice(0,2).join(r),c=[o||n.slice(2).join(r)]);let l=o||c.join(r);return s(l)?{name:i,entry:l}:{name:i,version:l||a}}else if(n.length===1){const[i]=n;return o&&s(o)?{name:i,entry:o}:{name:i,version:o||a}}else throw`Invalid entry value: ${t}`},hr=function(...t){return t.length?t.reduce((e,r)=>r?e?`${e}${Oe}${r}`:r:e,""):""},Le=function(t,e="",r=!1){try{const n=r?".js":"";return`${e}${t.replace(new RegExp(`${T.AT}`,"g"),v[T.AT]).replace(new RegExp(`${T.HYPHEN}`,"g"),v[T.HYPHEN]).replace(new RegExp(`${T.SLASH}`,"g"),v[T.SLASH])}${n}`}catch(n){throw n}},pr=function(t,e,r){try{let n=t;if(e){if(!n.startsWith(e))return n;n=n.replace(new RegExp(e,"g"),"")}return n=n.replace(new RegExp(`${v[T.AT]}`,"g"),de[v[T.AT]]).replace(new RegExp(`${v[T.SLASH]}`,"g"),de[v[T.SLASH]]).replace(new RegExp(`${v[T.HYPHEN]}`,"g"),de[v[T.HYPHEN]]),r&&(n=n.replace(".js","")),n}catch(n){throw n}},mr=(t,e)=>{if(!t)return"";let r=t;return r==="."&&(r="default_export"),r.startsWith("./")&&(r=r.replace("./","")),Le(r,"__federation_expose_",e)},_r=(t,e)=>t?Le(t,"__federation_shared_",e):"",Er=(t,e)=>{if("getPublicPath"in t){let r;return t.getPublicPath.startsWith("function")?r=new Function("return "+t.getPublicPath)()():r=new Function(t.getPublicPath)(),`${r}${e}`}else return"publicPath"in t?!ve()&&!tt()&&"ssrPublicPath"in t?`${t.ssrPublicPath}${e}`:`${t.publicPath}${e}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",t,e),"")},yr=(t,e)=>{t||ot(e)},ot=t=>{throw new Error(`${nt}: ${t}`)},st=t=>{console.warn(`${nt}: ${t}`)};function gr(t){try{return JSON.stringify(t,null,2)}catch{return""}}const br=/^([\d^=v<>~]|[*xX]$)/;function Sr(t){return br.test(t)}const K=(t,e)=>{if(!t)return e;const n=(o=>{if(o===".")return"";if(o.startsWith("./"))return o.replace("./","");if(o.startsWith("/")){const a=o.slice(1);return a.endsWith("/")?a.slice(0,-1):a}return o})(t);return n?n.endsWith("/")?`${n}${e}`:`${n}/${e}`:e};function it(t){return t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function Rr(t,e={}){const{remotes:r={},overrides:n={},version:o}=e;let a;const s=()=>"publicPath"in t.metaData?t.metaData.publicPath==="auto"&&o?it(o):t.metaData.publicPath:t.metaData.getPublicPath,i=Object.keys(n);let c={};Object.keys(r).length||(c=t.remotes?.reduce((E,b)=>{let $;const M=b.federationContainerName;return i.includes(M)?$=n[M]:"version"in b?$=b.version:$=b.entry,E[M]={matchedVersion:$},E},{})||{}),Object.keys(r).forEach(E=>c[E]={matchedVersion:i.includes(E)?n[E]:r[E]});const{remoteEntry:{path:l,name:u,type:d},types:f={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:p},globalName:_,ssrRemoteEntry:g}=t.metaData,{exposes:h}=t;let y={version:o||"",buildVersion:p,globalName:_,remoteEntry:K(l,u),remoteEntryType:d,remoteTypes:K(f.path,f.name),remoteTypesZip:f.zip||"",remoteTypesAPI:f.api||"",remotesInfo:c,shared:t?.shared.map(E=>({assets:E.assets,sharedName:E.name,version:E.version})),modules:h?.map(E=>({moduleName:E.name,modulePath:E.path,assets:E.assets}))};if(t.metaData?.prefetchInterface){const E=t.metaData.prefetchInterface;y={...y,prefetchInterface:E}}if(t.metaData?.prefetchEntry){const{path:E,name:b,type:$}=t.metaData.prefetchEntry;y={...y,prefetchEntry:K(E,b),prefetchEntryType:$}}if("publicPath"in t.metaData?a={...y,publicPath:s(),ssrPublicPath:t.metaData.ssrPublicPath}:a={...y,getPublicPath:s()},g){const E=K(g.path,g.name);a.ssrRemoteEntry=E,a.ssrRemoteEntryType=g.type||"commonjs-module"}return a}function Ir(t){return!!("remoteEntry"in t&&t.remoteEntry.includes(Pe))}function Nr(t){if(!t)return{statsFileName:Ne,manifestFileName:Ie};let e=typeof t=="boolean"?"":t.filePath||"",r=typeof t=="boolean"?"":t.fileName||"";const n=".json",o=c=>c.endsWith(n)?c:`${c}${n}`,a=(c,l)=>c.replace(n,`${l}${n}`),s=r?o(r):Ie,i=r?a(s,"-stats"):Ne;return{statsFileName:K(e,i),manifestFileName:K(e,s)}}const at="[ Module Federation ]",Z=console,$r=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Tr(){try{const t=new Error().stack;if(!t)return;const[,...e]=t.split(`
|
|
2
|
-
`),r=e.filter(o=>!$r.some(a=>o.includes(a)));return r.length?`Stack trace:
|
|
3
|
-
${r.slice(0,5).join(`
|
|
4
|
-
`)}`:void 0}catch{return}}class ct{constructor(e,r=Z){this.prefix=e,this.delegate=r??Z}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??Z}emit(e,r){const n=this.delegate,a=$e()?Tr():void 0,s=a?[...r,a]:r,i=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];case"debug":default:return["debug","log"]}})();for(const c of i){const l=n[c];if(typeof l=="function"){l.call(n,this.prefix,...s);return}}for(const c of i){const l=Z[c];if(typeof l=="function"){l.call(Z,this.prefix,...s);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){$e()&&this.emit("debug",e)}}function lt(t){return new ct(t)}function ut(t){const e=new ct(t);return Object.defineProperty(e,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),e}function Mr(t,e,r){if(t.__mf_infrastructure_logger__&&e?.getInfrastructureLogger)try{const n=e.getInfrastructureLogger(r);n&&typeof n=="object"&&(typeof n.log=="function"||typeof n.info=="function"||typeof n.warn=="function"||typeof n.error=="function")&&t.setDelegate(n)}catch{t.setDelegate(void 0)}}const wr=lt(at),Ar=ut(at);async function Fe(t,e){try{return await t()}catch(r){!e&&st(r);return}}function De(t,e){const r=/^(https?:)?\/\//i,n=t.replace(r,"").replace(/\/$/,""),o=e.replace(r,"").replace(/\/$/,"");return n===o}function ft(t){let e=null,r=!0,n=2e4,o;const a=document.getElementsByTagName("script");for(let i=0;i<a.length;i++){const c=a[i],l=c.getAttribute("src");if(l&&De(l,t.url)){e=c,r=!1;break}}if(!e){const i=t.attrs;e=document.createElement("script"),e.type=i?.type==="module"?"module":"text/javascript";let c;t.createScriptHook&&(c=t.createScriptHook(t.url,t.attrs),c instanceof HTMLScriptElement?e=c:typeof c=="object"&&("script"in c&&c.script&&(e=c.script),"timeout"in c&&c.timeout&&(n=c.timeout))),e.src||(e.src=t.url),i&&!c&&Object.keys(i).forEach(l=>{e&&(l==="async"||l==="defer"?e[l]=i[l]:e.getAttribute(l)||e.setAttribute(l,i[l]))})}const s=async(i,c)=>{clearTimeout(o);const l=()=>{c?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(c):t?.cb&&t?.cb()};if(e&&(e.onerror=null,e.onload=null,Fe(()=>{const{needDeleteScript:u=!0}=t;u&&e?.parentNode&&e.parentNode.removeChild(e)}),i&&typeof i=="function")){const u=i(c);if(u instanceof Promise){const d=await u;return l(),d}return l(),u}l()};return e.onerror=s.bind(null,e.onerror),e.onload=s.bind(null,e.onload),o=setTimeout(()=>{s(null,new Error(`Remote script "${t.url}" time-outed.`))},n),{script:e,needAttach:r}}function Pr(t){let e=null,r=!0;const n=document.getElementsByTagName("link");for(let a=0;a<n.length;a++){const s=n[a],i=s.getAttribute("href"),c=s.getAttribute("rel");if(i&&De(i,t.url)&&c===t.attrs.rel){e=s,r=!1;break}}if(!e){e=document.createElement("link"),e.setAttribute("href",t.url);let a;const s=t.attrs;t.createLinkHook&&(a=t.createLinkHook(t.url,s),a instanceof HTMLLinkElement&&(e=a)),s&&!a&&Object.keys(s).forEach(i=>{e&&!e.getAttribute(i)&&e.setAttribute(i,s[i])})}const o=(a,s)=>{const i=()=>{s?.type==="error"?t?.onErrorCallback&&t?.onErrorCallback(s):t?.cb&&t?.cb()};if(e&&(e.onerror=null,e.onload=null,Fe(()=>{const{needDeleteLink:c=!0}=t;c&&e?.parentNode&&e.parentNode.removeChild(e)}),a)){const c=a(s);return i(),c}i()};return e.onerror=o.bind(null,e.onerror),e.onload=o.bind(null,e.onload),{link:e,needAttach:r}}function Or(t,e){const{attrs:r={},createScriptHook:n}=e;return new Promise((o,a)=>{const{script:s,needAttach:i}=ft({url:t,cb:o,onErrorCallback:a,attrs:{fetchpriority:"high",...r},createScriptHook:n,needDeleteScript:!0});i&&document.head.appendChild(s)})}const vr=(t,e,r,n)=>{e(new Error("createScriptNode is disabled in non-Node.js environment"))},Lr=(t,e)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")};function Fr(t,e,r){return function(n){if(n===!1)return!1;if(typeof n>"u")return t?e:!1;if(n===!0)return e;if(n&&typeof n=="object")return{...e,...n};throw new Error(`Unexpected type for \`${r}\`, expect boolean/undefined/object, got: ${typeof n}`)}}const Dr=t=>t;m.BROWSER_LOG_KEY=et;m.ENCODE_NAME_PREFIX=or;m.EncodedNameTransformMap=de;m.FederationModuleManifest=tr;m.MANIFEST_EXT=Pe;m.MFModuleType=rr;m.MFPrefetchCommon=ir;m.MODULE_DEVTOOL_IDENTIFIER=nr;m.ManifestFileName=Ie;m.NameTransformMap=v;m.NameTransformSymbol=T;m.SEPARATOR=Oe;m.StatsFileName=Ne;m.TEMP_DIR=sr;m.assert=yr;m.bindLoggerToCompiler=Mr;m.composeKeyWithSeparator=hr;m.containerPlugin=ar;m.containerReferencePlugin=cr;m.createInfrastructureLogger=ut;m.createLink=Pr;m.createLogger=lt;m.createModuleFederationConfig=Dr;m.createScript=ft;m.createScriptNode=vr;m.decodeName=pr;m.encodeName=Le;m.error=ot;m.generateExposeFilename=mr;m.generateShareFilename=_r;m.generateSnapshotFromManifest=Rr;m.getManifestFileName=Nr;m.getProcessEnv=rt;m.getResourceUrl=Er;m.inferAutoPublicPath=it;m.infrastructureLogger=Ar;m.isBrowserEnv=ve;m.isDebugMode=$e;m.isManifestProvider=Ir;m.isReactNativeEnv=tt;m.isRequiredVersion=Sr;m.isStaticResourcesEqual=De;m.loadScript=Or;m.loadScriptNode=Lr;m.logger=wr;m.moduleFederationPlugin=lr;m.normalizeOptions=Fr;m.parseEntry=dr;m.safeToString=gr;m.safeWrapper=Fe;m.sharePlugin=ur;m.simpleJoinRemoteEntry=K;m.warn=st;var w={};const dt="RUNTIME-001",ht="RUNTIME-002",pt="RUNTIME-003",mt="RUNTIME-004",_t="RUNTIME-005",Et="RUNTIME-006",yt="RUNTIME-007",gt="RUNTIME-008",bt="RUNTIME-009",St="TYPE-001",Rt="BUILD-001",It="BUILD-002",kr=t=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${t.split("-")[0].toLowerCase()}/${t}`,Hr=(t,e,r,n)=>{const o=[`${[e[t]]} #${t}`];return r&&o.push(`args: ${JSON.stringify(r)}`),o.push(kr(t)),n&&o.push(`Original Error Message:
|
|
5
|
-
${n}`),o.join(`
|
|
6
|
-
`)},Nt={[dt]:"Failed to get remoteEntry exports.",[ht]:'The remote entry interface does not contain "init"',[pt]:"Failed to get manifest.",[mt]:"Failed to locate remote.",[_t]:"Invalid loadShareSync function call from bundler runtime",[Et]:"Invalid loadShareSync function call from runtime",[yt]:"Failed to get remote snapshot.",[gt]:"Failed to load script resources.",[bt]:"Please call createInstance first."},$t={[St]:"Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."},Tt={[Rt]:"Failed to find expose module.",[It]:"PublicPath is required in prod mode."},Cr={...Nt,...$t,...Tt};w.BUILD_001=Rt;w.BUILD_002=It;w.RUNTIME_001=dt;w.RUNTIME_002=ht;w.RUNTIME_003=pt;w.RUNTIME_004=mt;w.RUNTIME_005=_t;w.RUNTIME_006=Et;w.RUNTIME_007=yt;w.RUNTIME_008=gt;w.RUNTIME_009=bt;w.TYPE_001=St;w.buildDescMap=Tt;w.errorDescMap=Cr;w.getShortErrorMsg=Hr;w.runtimeDescMap=Nt;w.typeDescMap=$t;var S=m,R=w;const z="[ Federation Runtime ]",Te=S.createLogger(z);function O(t,e){t||x(e)}function x(t){throw t instanceof Error?(t.message.startsWith(z)||(t.message=`${z}: ${t.message}`),t):new Error(`${z}: ${t}`)}function ce(t){t instanceof Error&&(t.message.startsWith(z)||(t.message=`${z}: ${t.message}`)),Te.warn(t)}function qe(t,e){return t.findIndex(r=>r===e)===-1&&t.push(e),t}function ne(t){return"version"in t&&t.version?`${t.name}:${t.version}`:"entry"in t&&t.entry?`${t.name}:${t.entry}`:`${t.name}`}function ke(t){return typeof t.entry<"u"}function Mt(t){return!t.entry.includes(".json")}async function Gr(t,e){try{return await t()}catch(r){!e&&ce(r);return}}function He(t){return t&&typeof t=="object"}const xr=Object.prototype.toString;function Ur(t){return xr.call(t)==="[object Object]"}function Br(t,e){const r=/^(https?:)?\/\//i,n=t.replace(r,"").replace(/\/$/,""),o=e.replace(r,"").replace(/\/$/,"");return n===o}function wt(t){return Array.isArray(t)?t:[t]}function At(t){const e={url:"",type:"global",globalName:""};return S.isBrowserEnv()||S.isReactNativeEnv()?"remoteEntry"in t?{url:t.remoteEntry,type:t.remoteEntryType,globalName:t.globalName}:e:"ssrRemoteEntry"in t?{url:t.ssrRemoteEntry||e.url,type:t.ssrRemoteEntryType||e.type,globalName:t.globalName}:e}const Vr=(t,e)=>{let r;return t.endsWith("/")?r=t.slice(0,-1):r=t,e.startsWith(".")&&(e=e.slice(1)),r=r+e,r},N=typeof globalThis=="object"?globalThis:window,L=(()=>{try{return document.defaultView}catch{return N}})(),q=L;function he(t,e,r){Object.defineProperty(t,e,{value:r,configurable:!1,writable:!0})}function pe(t,e){return Object.hasOwnProperty.call(t,e)}pe(N,"__GLOBAL_LOADING_REMOTE_ENTRY__")||he(N,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const V=N.__GLOBAL_LOADING_REMOTE_ENTRY__;function Pt(t){pe(t,"__VMOK__")&&!pe(t,"__FEDERATION__")&&he(t,"__FEDERATION__",t.__VMOK__),pe(t,"__FEDERATION__")||(he(t,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),he(t,"__VMOK__",t.__FEDERATION__)),t.__FEDERATION__.__GLOBAL_PLUGIN__??=[],t.__FEDERATION__.__INSTANCES__??=[],t.__FEDERATION__.moduleInfo??={},t.__FEDERATION__.__SHARE__??={},t.__FEDERATION__.__MANIFEST_LOADING__??={},t.__FEDERATION__.__PRELOADED_MAP__??=new Map}Pt(N);Pt(L);function Ot(){N.__FEDERATION__.__GLOBAL_PLUGIN__=[],N.__FEDERATION__.__INSTANCES__=[],N.__FEDERATION__.moduleInfo={},N.__FEDERATION__.__SHARE__={},N.__FEDERATION__.__MANIFEST_LOADING__={},Object.keys(V).forEach(t=>{delete V[t]})}function vt(t){N.__FEDERATION__.__INSTANCES__.push(t)}function Lt(){return N.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function Ft(t,e=S.isDebugMode()){e&&(N.__FEDERATION__.__DEBUG_CONSTRUCTOR__=t,N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.21.6")}function j(t,e){if(typeof e=="string"){if(t[e])return{value:t[e],key:e};{const n=Object.keys(t);for(const o of n){const[a,s]=o.split(":"),i=`${a}:${e}`,c=t[i];if(c)return{value:c,key:i}}return{value:void 0,key:e}}}else throw new Error("key must be string")}const Ee=()=>L.__FEDERATION__.moduleInfo,Dt=(t,e)=>{const r=ne(t),n=j(e,r).value;if(n&&!n.version&&"version"in t&&t.version&&(n.version=t.version),n)return n;if("version"in t&&t.version){const{version:o,...a}=t,s=ne(a),i=j(L.__FEDERATION__.moduleInfo,s).value;if(i?.version===o)return i}},ee=t=>Dt(t,L.__FEDERATION__.moduleInfo),Me=(t,e)=>{const r=ne(t);return L.__FEDERATION__.moduleInfo[r]=e,L.__FEDERATION__.moduleInfo},Ce=t=>(L.__FEDERATION__.moduleInfo={...L.__FEDERATION__.moduleInfo,...t},()=>{const e=Object.keys(t);for(const r of e)delete L.__FEDERATION__.moduleInfo[r]}),ye=(t,e)=>{const r=e||`__FEDERATION_${t}:custom__`,n=N[r];return{remoteEntryKey:r,entryExports:n}},kt=t=>{const{__GLOBAL_PLUGIN__:e}=L.__FEDERATION__;t.forEach(r=>{e.findIndex(n=>n.name===r.name)===-1?e.push(r):ce(`The plugin ${r.name} has been registered.`)})},Ht=()=>L.__FEDERATION__.__GLOBAL_PLUGIN__,Ct=t=>N.__FEDERATION__.__PRELOADED_MAP__.get(t),Gt=t=>N.__FEDERATION__.__PRELOADED_MAP__.set(t,!0),le="default",xt="global",ze="[0-9A-Za-z-]+",Ge=`(?:\\+(${ze}(?:\\.${ze})*))`,te="0|[1-9]\\d*",me="[0-9]+",Ut="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Ye=`(?:${me}|${Ut})`,Wr=`(?:-?(${Ye}(?:\\.${Ye})*))`,Xe=`(?:${te}|${Ut})`,Bt=`(?:-(${Xe}(?:\\.${Xe})*))`,be=`${te}|x|X|\\*`,J=`[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${Bt})?${Ge}?)?)?`,jr=`^\\s*(${J})\\s+-\\s+(${J})\\s*$`,Kr=`(${me})\\.(${me})\\.(${me})`,qr=`[v=\\s]*${Kr}${Wr}?${Ge}?`,xe="((?:<|>)?=?)",zr=`(\\s*)${xe}\\s*(${qr}|${J})`,Vt="(?:~>?)",Yr=`(\\s*)${Vt}\\s+`,Wt="(?:\\^)",Xr=`(\\s*)${Wt}\\s+`,Jr="(<|>)?=?\\s*\\*",Zr=`^${Wt}${J}$`,Qr=`(${te})\\.(${te})\\.(${te})`,en=`v?${Qr}${Bt}?${Ge}?`,tn=`^${Vt}${J}$`,rn=`^${xe}\\s*${J}$`,nn=`^${xe}\\s*(${en})$|^$`,on="^\\s*>=\\s*0.0.0\\s*$";function U(t){return new RegExp(t)}function P(t){return!t||t.toLowerCase()==="x"||t==="*"}function jt(...t){return e=>t.reduce((r,n)=>n(r),e)}function Je(t){return t.match(U(nn))}function Ze(t,e,r,n){const o=`${t}.${e}.${r}`;return n?`${o}-${n}`:o}function sn(t){return t.replace(U(jr),(e,r,n,o,a,s,i,c,l,u,d,f)=>(P(n)?r="":P(o)?r=`>=${n}.0.0`:P(a)?r=`>=${n}.${o}.0`:r=`>=${r}`,P(l)?c="":P(u)?c=`<${Number(l)+1}.0.0-0`:P(d)?c=`<${l}.${Number(u)+1}.0-0`:f?c=`<=${l}.${u}.${d}-${f}`:c=`<=${c}`,`${r} ${c}`.trim()))}function an(t){return t.replace(U(zr),"$1$2$3")}function cn(t){return t.replace(U(Yr),"$1~")}function ln(t){return t.replace(U(Xr),"$1^")}function un(t){return t.trim().split(/\s+/).map(e=>e.replace(U(Zr),(r,n,o,a,s)=>P(n)?"":P(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:P(a)?n==="0"?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.0 <${Number(n)+1}.0.0-0`:s?n==="0"?o==="0"?`>=${n}.${o}.${a}-${s} <${n}.${o}.${Number(a)+1}-0`:`>=${n}.${o}.${a}-${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${a}-${s} <${Number(n)+1}.0.0-0`:n==="0"?o==="0"?`>=${n}.${o}.${a} <${n}.${o}.${Number(a)+1}-0`:`>=${n}.${o}.${a} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${a} <${Number(n)+1}.0.0-0`)).join(" ")}function fn(t){return t.trim().split(/\s+/).map(e=>e.replace(U(tn),(r,n,o,a,s)=>P(n)?"":P(o)?`>=${n}.0.0 <${Number(n)+1}.0.0-0`:P(a)?`>=${n}.${o}.0 <${n}.${Number(o)+1}.0-0`:s?`>=${n}.${o}.${a}-${s} <${n}.${Number(o)+1}.0-0`:`>=${n}.${o}.${a} <${n}.${Number(o)+1}.0-0`)).join(" ")}function dn(t){return t.split(/\s+/).map(e=>e.trim().replace(U(rn),(r,n,o,a,s,i)=>{const c=P(o),l=c||P(a),u=l||P(s);return n==="="&&u&&(n=""),i="",c?n===">"||n==="<"?"<0.0.0-0":"*":n&&u?(l&&(a=0),s=0,n===">"?(n=">=",l?(o=Number(o)+1,a=0,s=0):(a=Number(a)+1,s=0)):n==="<="&&(n="<",l?o=Number(o)+1:a=Number(a)+1),n==="<"&&(i="-0"),`${n+o}.${a}.${s}${i}`):l?`>=${o}.0.0${i} <${Number(o)+1}.0.0-0`:u?`>=${o}.${a}.0${i} <${o}.${Number(a)+1}.0-0`:r})).join(" ")}function hn(t){return t.trim().replace(U(Jr),"")}function pn(t){return t.trim().replace(U(on),"")}function _e(t,e){return t=Number(t)||t,e=Number(e)||e,t>e?1:t===e?0:-1}function mn(t,e){const{preRelease:r}=t,{preRelease:n}=e;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,a=r.length;o<=a;o++){const s=r[o],i=n[o];if(s!==i)return s===void 0&&i===void 0?0:s?i?_e(s,i):-1:1}return 0}function ue(t,e){return _e(t.major,e.major)||_e(t.minor,e.minor)||_e(t.patch,e.patch)||mn(t,e)}function Se(t,e){return t.version===e.version}function _n(t,e){switch(t.operator){case"":case"=":return Se(t,e);case">":return ue(t,e)<0;case">=":return Se(t,e)||ue(t,e)<0;case"<":return ue(t,e)>0;case"<=":return Se(t,e)||ue(t,e)>0;case void 0:return!0;default:return!1}}function En(t){return jt(un,fn,dn,hn)(t)}function yn(t){return jt(sn,an,cn,ln)(t.trim()).split(/\s+/).join(" ")}function re(t,e){if(!t)return!1;const r=Je(t);if(!r)return!1;const[,n,,o,a,s,i]=r,c={operator:n,version:Ze(o,a,s,i),major:o,minor:a,patch:s,preRelease:i?.split(".")},l=e.split("||");for(const u of l){const d=u.trim();if(!d||d==="*"||d==="x")return!0;try{const f=yn(d);if(!f.trim())return!0;const p=f.split(" ").map(h=>En(h)).join(" ");if(!p.trim())return!0;const _=p.split(/\s+/).map(h=>pn(h)).filter(Boolean);if(_.length===0)continue;let g=!0;for(const h of _){const y=Je(h);if(!y){g=!1;break}const[,E,,b,$,M,B]=y,A={operator:E,version:Ze(b,$,M,B),major:b,minor:$,patch:M,preRelease:B?.split(".")};if(!_n(A,c)){g=!1;break}}if(g)return!0}catch(f){console.error(`[semver] Error processing range part "${d}":`,f);continue}}return!1}function gn(t,e,r,n){let o;return"get"in t?o=t.get:"lib"in t?o=()=>Promise.resolve(t.lib):o=()=>Promise.resolve(()=>{throw new Error(`Can not get shared '${r}'!`)}),{deps:[],useIn:[],from:e,loading:null,...t,shareConfig:{requiredVersion:`^${t.version}`,singleton:!1,eager:!1,strictVersion:!1,...t.shareConfig},get:o,loaded:t?.loaded||"lib"in t?!0:void 0,version:t.version??"0",scope:Array.isArray(t.scope)?t.scope:[t.scope??"default"],strategy:(t.strategy??n)||"version-first"}}function Kt(t,e){const r=e.shared||{},n=e.name,o=Object.keys(r).reduce((s,i)=>{const c=wt(r[i]);return s[i]=s[i]||[],c.forEach(l=>{s[i].push(gn(l,n,i,e.shareStrategy))}),s},{}),a={...t.shared};return Object.keys(o).forEach(s=>{a[s]?o[s].forEach(i=>{a[s].find(l=>l.version===i.version)||a[s].push(i)}):a[s]=o[s]}),{shared:a,shareInfos:o}}function oe(t,e){const r=n=>{if(!Number.isNaN(Number(n))){const a=n.split(".");let s=n;for(let i=0;i<3-a.length;i++)s+=".0";return s}return n};return!!re(r(t),`<=${r(e)}`)}const Ue=(t,e)=>{const r=e||function(n,o){return oe(n,o)};return Object.keys(t).reduce((n,o)=>!n||r(n,o)||n==="0"?o:n,0)},Be=t=>!!t.loaded||typeof t.lib=="function",bn=t=>!!t.loading;function Sn(t,e,r){const n=t[e][r],o=function(a,s){return!Be(n[a])&&oe(a,s)};return Ue(t[e][r],o)}function Rn(t,e,r){const n=t[e][r],o=function(a,s){const i=c=>Be(c)||bn(c);return i(n[s])?i(n[a])?!!oe(a,s):!0:i(n[a])?!1:oe(a,s)};return Ue(t[e][r],o)}function In(t){return t==="loaded-first"?Rn:Sn}function Y(t,e,r,n){if(!t)return;const{shareConfig:o,scope:a=le,strategy:s}=r,i=Array.isArray(a)?a:[a];for(const c of i)if(o&&t[c]&&t[c][e]){const{requiredVersion:l}=o,d=In(s)(t,c,e),f=()=>{if(o.singleton){if(typeof l=="string"&&!re(d,l)){const g=`Version ${d} from ${d&&t[c][e][d].from} of shared singleton module ${e} does not satisfy the requirement of ${r.from} which needs ${l})`;o.strictVersion?x(g):ce(g)}return t[c][e][d]}else{if(l===!1||l==="*"||re(d,l))return t[c][e][d];for(const[g,h]of Object.entries(t[c][e]))if(re(g,l))return h}},p={shareScopeMap:t,scope:c,pkgName:e,version:d,GlobalFederation:q.__FEDERATION__,resolver:f};return(n.emit(p)||p).resolver()}}function Ve(){return q.__FEDERATION__.__SHARE__}function Qe(t){const{pkgName:e,extraOptions:r,shareInfos:n}=t,o=s=>{if(!s)return;const i={};s.forEach(u=>{i[u.version]=u});const l=Ue(i,function(u,d){return!Be(i[u])&&oe(u,d)});return i[l]},a=r?.resolver??o;return Object.assign({},a(n[e]),r?.customShareInfo)}function Nn(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function We(t,e){for(const r of t){const n=e.startsWith(r.name);let o=e.replace(r.name,"");if(n){if(o.startsWith("/")){const i=r.name;return o=`.${o}`,{pkgNameOrAlias:i,expose:o,remote:r}}else if(o==="")return{pkgNameOrAlias:r.name,expose:".",remote:r}}const a=r.alias&&e.startsWith(r.alias);let s=r.alias&&e.replace(r.alias,"");if(r.alias&&a){if(s&&s.startsWith("/")){const i=r.alias;return s=`.${s}`,{pkgNameOrAlias:i,expose:s,remote:r}}else if(s==="")return{pkgNameOrAlias:r.alias,expose:".",remote:r}}}}function $n(t,e){for(const r of t)if(e===r.name||r.alias&&e===r.alias)return r}function Tn(t,e){const r=Ht(),n=[e.hooks,e.remoteHandler.hooks,e.sharedHandler.hooks,e.snapshotHandler.hooks,e.loaderHook,e.bridgeHook];return r.length>0&&r.forEach(o=>{t?.find(a=>a.name!==o.name)&&t.push(o)}),t&&t.length>0&&t.forEach(o=>{n.forEach(a=>{a.applyPlugin(o,e)})}),t}const qt=".then(callbacks[0]).catch(callbacks[1])";async function Mn({entry:t,remoteEntryExports:e}){return new Promise((r,n)=>{try{e?r(e):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${t}")${qt}`)([r,n]):import(t).then(r).catch(n)}catch(o){n(o)}})}async function wn({entry:t,remoteEntryExports:e}){return new Promise((r,n)=>{try{e?r(e):typeof __system_context__>"u"?System.import(t).then(r).catch(n):new Function("callbacks",`System.import("${t}")${qt}`)([r,n])}catch(o){n(o)}})}function zt(t,e,r){const{remoteEntryKey:n,entryExports:o}=ye(t,e);return O(o,R.getShortErrorMsg(R.RUNTIME_001,R.runtimeDescMap,{remoteName:t,remoteEntryUrl:r,remoteEntryKey:n})),o}async function An({name:t,globalName:e,entry:r,loaderHook:n,getEntryUrl:o}){const{entryExports:a}=ye(t,e);if(a)return a;const s=o?o(r):r;return S.loadScript(s,{attrs:{},createScriptHook:(i,c)=>{const l=n.lifecycle.createScript.emit({url:i,attrs:c});if(l&&(l instanceof HTMLScriptElement||"script"in l||"timeout"in l))return l}}).then(()=>zt(t,e,r)).catch(i=>{throw O(void 0,R.getShortErrorMsg(R.RUNTIME_008,R.runtimeDescMap,{remoteName:t,resourceUrl:r})),i})}async function Pn({remoteInfo:t,remoteEntryExports:e,loaderHook:r,getEntryUrl:n}){const{entry:o,entryGlobalName:a,name:s,type:i}=t;switch(i){case"esm":case"module":return Mn({entry:o,remoteEntryExports:e});case"system":return wn({entry:o,remoteEntryExports:e});default:return An({entry:o,globalName:a,name:s,loaderHook:r,getEntryUrl:n})}}async function On({remoteInfo:t,loaderHook:e}){const{entry:r,entryGlobalName:n,name:o,type:a}=t,{entryExports:s}=ye(o,n);return s||S.loadScriptNode(r,{attrs:{name:o,globalName:n,type:a},loaderHook:{createScriptHook:(i,c={})=>{const l=e.lifecycle.createScript.emit({url:i,attrs:c});if(l&&"url"in l)return l}}}).then(()=>zt(o,n,r)).catch(i=>{throw i})}function we(t){const{entry:e,name:r}=t;return S.composeKeyWithSeparator(r,e)}async function se(t){const{origin:e,remoteEntryExports:r,remoteInfo:n,getEntryUrl:o,_inErrorHandling:a=!1}=t,s=we(n);if(r)return r;if(!V[s]){const i=e.remoteHandler.hooks.lifecycle.loadEntry,c=e.loaderHook;V[s]=i.emit({loaderHook:c,remoteInfo:n,remoteEntryExports:r}).then(l=>l||(!0?Pn({remoteInfo:n,remoteEntryExports:r,loaderHook:c,getEntryUrl:o}):On({remoteInfo:n,loaderHook:c}))).catch(async l=>{const u=we(n);if(l instanceof Error&&l.message.includes(R.RUNTIME_008)&&!a){const f=_=>se({..._,_inErrorHandling:!0}),p=await e.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:f,origin:e,remoteInfo:n,remoteEntryExports:r,globalLoading:V,uniqueKey:u});if(p)return p}throw l})}return V[s]}function ie(t){return{...t,entry:"entry"in t?t.entry:"",type:t.type||xt,entryGlobalName:t.entryGlobalName||t.name,shareScope:t.shareScope||le}}function Yt(t){return{resourceCategory:"sync",share:!0,depsRemote:!0,prefetchInterface:!1,...t}}function vn(t,e){return e.map(r=>{const n=$n(t,r.nameOrAlias);return O(n,`Unable to preload ${r.nameOrAlias} as it is not included in ${!n&&S.safeToString({remoteInfo:n,remotes:t})}`),{remote:n,preloadConfig:Yt(r)}})}function Ln(t){return t?t.map(e=>e==="."?e:e.startsWith("./")?e.replace("./",""):e):[]}function je(t,e,r,n=!0){const{cssAssets:o,jsAssetsWithoutEntry:a,entryAssets:s}=r;if(e.options.inBrowser){if(s.forEach(i=>{const{moduleInfo:c}=i,l=e.moduleCache.get(t.name);se(l?{origin:e,remoteInfo:c,remoteEntryExports:l.remoteEntryExports}:{origin:e,remoteInfo:c,remoteEntryExports:void 0})}),n){const i={rel:"preload",as:"style"};o.forEach(c=>{const{link:l,needAttach:u}=S.createLink({url:c,cb:()=>{},attrs:i,createLinkHook:(d,f)=>{const p=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(p instanceof HTMLLinkElement)return p}});u&&document.head.appendChild(l)})}else{const i={rel:"stylesheet",type:"text/css"};o.forEach(c=>{const{link:l,needAttach:u}=S.createLink({url:c,cb:()=>{},attrs:i,createLinkHook:(d,f)=>{const p=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(p instanceof HTMLLinkElement)return p},needDeleteLink:!1});u&&document.head.appendChild(l)})}if(n){const i={rel:"preload",as:"script"};a.forEach(c=>{const{link:l,needAttach:u}=S.createLink({url:c,cb:()=>{},attrs:i,createLinkHook:(d,f)=>{const p=e.loaderHook.lifecycle.createLink.emit({url:d,attrs:f});if(p instanceof HTMLLinkElement)return p}});u&&document.head.appendChild(l)})}else{const i={fetchpriority:"high",type:t?.type==="module"?"module":"text/javascript"};a.forEach(c=>{const{script:l,needAttach:u}=S.createScript({url:c,cb:()=>{},attrs:i,createScriptHook:(d,f)=>{const p=e.loaderHook.lifecycle.createScript.emit({url:d,attrs:f});if(p instanceof HTMLScriptElement)return p},needDeleteScript:!0});u&&document.head.appendChild(l)})}}}const Fn={getRegisteredShare:Y,getGlobalShareScope:Ve},Dn={Global:q,nativeGlobal:L,resetFederationGlobalInfo:Ot,setGlobalFederationInstance:vt,getGlobalFederationConstructor:Lt,setGlobalFederationConstructor:Ft,getInfoWithoutType:j,getGlobalSnapshot:Ee,getTargetSnapshotInfoByModuleInfo:Dt,getGlobalSnapshotInfoByModuleInfo:ee,setGlobalSnapshotInfoByModuleInfo:Me,addGlobalSnapshot:Ce,getRemoteEntryExports:ye,registerGlobalPlugins:kt,getGlobalHostPlugins:Ht,getPreloaded:Ct,setPreloaded:Gt};var kn={global:Dn,share:Fn,utils:{matchRemoteWithNameAndExpose:We,preloadAssets:je,getRemoteInfo:ie}};class Ke{constructor({remoteInfo:e,host:r}){this.inited=!1,this.lib=void 0,this.remoteInfo=e,this.host=r}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;let e;return e=await se({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports}),O(e,`remoteEntryExports is undefined
|
|
7
|
-
${S.safeToString(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async get(e,r,n,o){const{loadFactory:a=!0}=n||{loadFactory:!0},s=await this.getEntry();if(!this.inited){const d=this.host.shareScopeMap,f=Array.isArray(this.remoteInfo.shareScope)?this.remoteInfo.shareScope:[this.remoteInfo.shareScope];f.length||f.push("default"),f.forEach(y=>{d[y]||(d[y]={})});const p=d[f[0]],_=[],g={version:this.remoteInfo.version||"",shareScopeKeys:Array.isArray(this.remoteInfo.shareScope)?f:this.remoteInfo.shareScope||"default"};Object.defineProperty(g,"shareScopeMap",{value:d,enumerable:!1});const h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:p,remoteEntryInitOptions:g,initScope:_,remoteInfo:this.remoteInfo,origin:this.host});typeof s?.init>"u"&&x(R.getShortErrorMsg(R.RUNTIME_002,R.runtimeDescMap,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName})),await s.init(h.shareScope,h.initScope,h.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...h,id:e,remoteSnapshot:o,remoteEntryExports:s})}this.lib=s,this.inited=!0;let i;i=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:s,expose:r,moduleInfo:this.remoteInfo}),i||(i=await s.get(r)),O(i,`${ne(this.remoteInfo)} remote don't export ${r}.`);const c=Vr(this.remoteInfo.name,r),l=this.wraperFactory(i,c);return a?await l():l}wraperFactory(e,r){function n(o,a){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:a,enumerable:!1})}return e instanceof Promise?async()=>{const o=await e();return n(o,r),o}:()=>{const o=e();return n(o,r),o}}}class D{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const r=this;this.on(function n(...o){return r.remove(n),e.apply(null,o)})}emit(...e){let r;return this.listeners.size>0&&this.listeners.forEach(n=>{r=n(...e)}),r}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}}class C extends D{emit(...e){let r;const n=Array.from(this.listeners);if(n.length>0){let o=0;const a=s=>s===!1?!1:o<n.length?Promise.resolve(n[o++].apply(null,e)).then(a):s;r=a()}return Promise.resolve(r)}}function Xt(t,e){if(!He(e))return!1;if(t!==e){for(const r in t)if(!(r in e))return!1}return!0}class ae extends D{constructor(e){super(),this.onerror=x,this.type=e}emit(e){He(e)||x(`The data for the "${this.type}" hook should be an object.`);for(const r of this.listeners)try{const n=r(e);if(Xt(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){ce(n),this.onerror(n)}return e}}class W extends D{constructor(e){super(),this.onerror=x,this.type=e}emit(e){He(e)||x(`The response data for the "${this.type}" hook must be an object.`);const r=Array.from(this.listeners);if(r.length>0){let n=0;const o=s=>(ce(s),this.onerror(s),e),a=s=>{if(Xt(e,s)){if(e=s,n<r.length)try{return Promise.resolve(r[n++](e)).then(a,o)}catch(i){return o(i)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(a(e))}return Promise.resolve(e)}}class X{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,r){O(Ur(e),"Plugin configuration is invalid.");const n=e.name;O(n,"A name must be provided by the plugin."),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply?.(r),Object.keys(this.lifecycle).forEach(o=>{const a=e[o];a&&this.lifecycle[o].on(a)}))}removePlugin(e){O(e,"A name is required.");const r=this.registerPlugins[e];O(r,`The plugin "${e}" is not registered.`),Object.keys(r).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(r[n])})}}function Jt(t,e){const r=At(e);r.url||x(`The attribute remoteEntry of ${t.name} must not be undefined.`);let n=S.getResourceUrl(e,r.url);!S.isBrowserEnv()&&!n.startsWith("http")&&(n=`https:${n}`),t.type=r.type,t.entryGlobalName=r.globalName,t.entry=n,t.version=e.version,t.buildVersion=e.buildVersion}function Hn(){return{name:"snapshot-plugin",async afterResolve(t){const{remote:e,pkgNameOrAlias:r,expose:n,origin:o,remoteInfo:a,id:s}=t;if(!ke(e)||!Mt(e)){const{remoteSnapshot:i,globalSnapshot:c}=await o.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:e,id:s});Jt(a,i);const l={remote:e,preloadConfig:{nameOrAlias:r,exposes:[n],resourceCategory:"sync",share:!1,depsRemote:!1}},u=await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:o,preloadOptions:l,remoteInfo:a,remote:e,remoteSnapshot:i,globalSnapshot:c});return u&&je(a,o,u,!1),{...t,remoteSnapshot:i}}return t}}}function Cn(t){const e=t.split(":");return e.length===1?{name:e[0],version:void 0}:e.length===2?{name:e[0],version:e[1]}:{name:e[1],version:e[2]}}function Zt(t,e,r,n,o={},a){const s=ne(e),{value:i}=j(t,s),c=a||i;if(c&&!S.isManifestProvider(c)&&(r(c,e,n),c.remotesInfo)){const l=Object.keys(c.remotesInfo);for(const u of l){if(o[u])continue;o[u]=!0;const d=Cn(u),f=c.remotesInfo[u];Zt(t,{name:d.name,version:f.matchedVersion},r,!1,o,void 0)}}}const Re=(t,e)=>document.querySelector(`${t}[${t==="link"?"href":"src"}="${e}"]`);function Gn(t,e,r,n,o){const a=[],s=[],i=[],c=new Set,l=new Set,{options:u}=t,{preloadConfig:d}=e,{depsRemote:f}=d;if(Zt(n,r,(h,y,E)=>{let b;if(E)b=d;else if(Array.isArray(f)){const H=f.find(F=>F.nameOrAlias===y.name||F.nameOrAlias===y.alias);if(!H)return;b=Yt(H)}else if(f===!0)b=d;else return;const $=S.getResourceUrl(h,At(h).url);$&&i.push({name:y.name,moduleInfo:{name:y.name,entry:$,type:"remoteEntryType"in h?h.remoteEntryType:"global",entryGlobalName:"globalName"in h?h.globalName:y.name,shareScope:"",version:"version"in h?h.version:void 0},url:$});let M="modules"in h?h.modules:[];const B=Ln(b.exposes);B.length&&"modules"in h&&(M=h?.modules?.reduce((H,F)=>(B?.indexOf(F.moduleName)!==-1&&H.push(F),H),[]));function A(H){const F=H.map(G=>S.getResourceUrl(h,G));return b.filter?F.filter(b.filter):F}if(M){const H=M.length;for(let F=0;F<H;F++){const G=M[F],ge=`${y.name}/${G.moduleName}`;t.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:G.moduleName==="."?y.name:ge,name:y.name,remoteSnapshot:h,preloadConfig:b,remote:y,origin:t}),!Ct(ge)&&(b.resourceCategory==="all"?(a.push(...A(G.assets.css.async)),a.push(...A(G.assets.css.sync)),s.push(...A(G.assets.js.async)),s.push(...A(G.assets.js.sync))):(b.resourceCategory="sync")&&(a.push(...A(G.assets.css.sync)),s.push(...A(G.assets.js.sync))),Gt(ge))}}},!0,{},o),o.shared&&o.shared.length>0){const h=(y,E)=>{const b=Y(t.shareScopeMap,E.sharedName,y,t.sharedHandler.hooks.lifecycle.resolveShare);b&&typeof b.lib=="function"&&(E.assets.js.sync.forEach($=>{c.add($)}),E.assets.css.sync.forEach($=>{l.add($)}))};o.shared.forEach(y=>{const E=u.shared?.[y.sharedName];if(!E)return;const b=y.version?E.find(M=>M.version===y.version):E;if(!b)return;wt(b).forEach(M=>{h(M,y)})})}const _=s.filter(h=>!c.has(h)&&!Re("script",h));return{cssAssets:a.filter(h=>!l.has(h)&&!Re("link",h)),jsAssetsWithoutEntry:_,entryAssets:i.filter(h=>!Re("script",h.url))}}const xn=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(t){const{origin:e,preloadOptions:r,remoteInfo:n,remote:o,globalSnapshot:a,remoteSnapshot:s}=t;return S.isBrowserEnv()?ke(o)&&Mt(o)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:o.name,url:o.entry,moduleInfo:{name:n.name,entry:o.entry,type:n.type||"global",entryGlobalName:"",shareScope:""}}]}:(Jt(n,s),Gn(e,r,n,a,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function Qt(t,e){const r=ee({name:e.name,version:e.options.version}),n=r&&"remotesInfo"in r&&r.remotesInfo&&j(r.remotesInfo,t.name).value;return n&&n.matchedVersion?{hostGlobalSnapshot:r,globalSnapshot:Ee(),remoteSnapshot:ee({name:t.name,version:n.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Ee(),remoteSnapshot:ee({name:t.name,version:"version"in t?t.version:void 0})}}class Un{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new X({beforeLoadRemoteSnapshot:new C("beforeLoadRemoteSnapshot"),loadSnapshot:new W("loadGlobalSnapshot"),loadRemoteSnapshot:new W("loadRemoteSnapshot"),afterLoadSnapshot:new W("afterLoadSnapshot")}),this.manifestLoading=q.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:r,expose:n}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e});let a=ee({name:this.HostInstance.options.name,version:this.HostInstance.options.version});a||(a={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Ce({[this.HostInstance.options.name]:a})),a&&"remotesInfo"in a&&!j(a.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(a.remotesInfo={...a?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:c}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:s,remoteSnapshot:i,globalSnapshot:c});let d,f;if(l)if(S.isManifestProvider(l)){const p=S.isBrowserEnv()?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||"",_=await this.getManifestJson(p,e,{}),g=Me({...e,entry:p},_);d=_,f=g}else{const{remoteSnapshot:p}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:"global"});d=p,f=u}else if(ke(e)){const p=await this.getManifestJson(e.entry,e,{}),_=Me(e,p),{remoteSnapshot:g}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:p,from:"global"});d=g,f=_}else x(R.getShortErrorMsg(R.RUNTIME_007,R.runtimeDescMap,{hostName:e.name,hostVersion:e.version,globalSnapshot:JSON.stringify(u)}));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:r,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:d}),{remoteSnapshot:d,globalSnapshot:f}}getGlobalRemoteInfo(e){return Qt(e,this.HostInstance)}async getManifestJson(e,r,n){const o=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],x(R.getShortErrorMsg(R.RUNTIME_003,R.runtimeDescMap,{manifestUrl:e,moduleName:r.name,hostName:this.HostInstance.options.name},`${i}`)))}return O(s.metaData&&s.exposes&&s.shared,`${e} is not a federation manifest`),this.manifestCache.set(e,s),s},a=async()=>{const s=await o(),i=S.generateSnapshotFromManifest(s,{version:e}),{remoteSnapshot:c}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:r,manifestJson:s,remoteSnapshot:i,manifestUrl:e,from:"manifest"});return c};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(s=>s)),this.manifestLoading[e]}}class Bn{constructor(e){this.hooks=new X({afterResolve:new W("afterResolve"),beforeLoadShare:new W("beforeLoadShare"),loadShare:new C,resolveShare:new ae("resolveShare"),initContainerShareScopeMap:new ae("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,r){const{shareInfos:n,shared:o}=Kt(e,r);return Object.keys(n).forEach(s=>{n[s].forEach(c=>{c.scope.forEach(l=>{this.shareScopeMap[l]?.[s]||this.setShared({pkgName:s,lib:c.lib,get:c.get,loaded:c.loaded||!!c.lib,shared:c,from:r.name})})})}),{shareInfos:n,shared:o}}async loadShare(e,r){const{host:n}=this,o=Qe({pkgName:e,extraOptions:r,shareInfos:n.options.shared});o?.scope&&await Promise.all(o.scope.map(async l=>{await Promise.all(this.initializeSharing(l,{strategy:o.strategy}))}));const a=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:o,shared:n.options.shared,origin:n}),{shareInfo:s}=a;O(s,`Cannot find ${e} Share in the ${n.options.name}. Please ensure that the ${e} Share parameters have been injected`);const i=Y(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare),c=l=>{l.useIn||(l.useIn=[]),qe(l.useIn,n.options.name)};if(i&&i.lib)return c(i),i.lib;if(i&&i.loading&&!i.loaded){const l=await i.loading;return i.loaded=!0,i.lib||(i.lib=l),c(i),l}else if(i){const u=(async()=>{const d=await i.get();return c(i),i.loaded=!0,i.lib=d,d})();return this.setShared({pkgName:e,loaded:!1,shared:i,from:n.options.name,lib:null,loading:u}),u}else{if(r?.customShareInfo)return!1;const u=(async()=>{const d=await s.get();s.lib=d,s.loaded=!0,c(s);const f=Y(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare);return f&&(f.lib=d,f.loaded=!0,f.from=s.from),d})();return this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:u}),u}}initializeSharing(e=le,r){const{host:n}=this,o=r?.from,a=r?.strategy;let s=r?.initScope;const i=[];if(o!=="build"){const{initTokens:_}=this;s||(s=[]);let g=_[e];if(g||(g=_[e]={from:this.host.name}),s.indexOf(g)>=0)return i;s.push(g)}const c=this.shareScopeMap,l=n.options.name;c[e]||(c[e]={});const u=c[e],d=(_,g)=>{const{version:h,eager:y}=g;u[_]=u[_]||{};const E=u[_],b=E[h],$=!!(b&&(b.eager||b.shareConfig?.eager));(!b||b.strategy!=="loaded-first"&&!b.loaded&&(!y!=!$?y:l>b.from))&&(E[h]=g)},f=_=>_&&_.init&&_.init(c[e],s),p=async _=>{const{module:g}=await n.remoteHandler.getRemoteModuleAndOptions({id:_});if(g.getEntry){let h;try{h=await g.getEntry()}catch(y){h=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:_,error:y,from:"runtime",lifecycle:"beforeLoadShare",origin:n})}g.inited||(await f(h),g.inited=!0)}};return Object.keys(n.options.shared).forEach(_=>{n.options.shared[_].forEach(h=>{h.scope.includes(e)&&d(_,h)})}),(n.options.shareStrategy==="version-first"||a==="version-first")&&n.options.remotes.forEach(_=>{_.shareScope===e&&i.push(p(_.name))}),i}loadShareSync(e,r){const{host:n}=this,o=Qe({pkgName:e,extraOptions:r,shareInfos:n.options.shared});o?.scope&&o.scope.forEach(i=>{this.initializeSharing(i,{strategy:o.strategy})});const a=Y(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare),s=i=>{i.useIn||(i.useIn=[]),qe(i.useIn,n.options.name)};if(a){if(typeof a.lib=="function")return s(a),a.loaded||(a.loaded=!0,a.from===n.options.name&&(o.loaded=!0)),a.lib;if(typeof a.get=="function"){const i=a.get();if(!(i instanceof Promise))return s(a),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:i,shared:a}),i}}if(o.lib)return o.loaded||(o.loaded=!0),o.lib;if(o.get){const i=o.get();if(i instanceof Promise){const c=r?.from==="build"?R.RUNTIME_005:R.RUNTIME_006;throw new Error(R.getShortErrorMsg(c,R.runtimeDescMap,{hostName:n.options.name,sharedPkgName:e}))}return o.lib=i,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:o.lib,shared:o}),o.lib}throw new Error(R.getShortErrorMsg(R.RUNTIME_006,R.runtimeDescMap,{hostName:n.options.name,sharedPkgName:e}))}initShareScopeMap(e,r,n={}){const{host:o}=this;this.shareScopeMap[e]=r,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:r,options:o.options,origin:o,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:r,from:n,lib:o,loading:a,loaded:s,get:i}){const{version:c,scope:l="default",...u}=r;(Array.isArray(l)?l:[l]).forEach(f=>{if(this.shareScopeMap[f]||(this.shareScopeMap[f]={}),this.shareScopeMap[f][e]||(this.shareScopeMap[f][e]={}),!this.shareScopeMap[f][e][c]){this.shareScopeMap[f][e][c]={version:c,scope:[f],...u,lib:o,loaded:s,loading:a},i&&(this.shareScopeMap[f][e][c].get=i);return}const p=this.shareScopeMap[f][e][c];a&&!p.loading&&(p.loading=a),s&&!p.loaded&&(p.loaded=s),n&&p.from!==n&&(p.from=n)})}_setGlobalShareScopeMap(e){const r=Ve(),n=e.id||e.name;n&&!r[n]&&(r[n]=this.shareScopeMap)}}class Vn{constructor(e){this.hooks=new X({beforeRegisterRemote:new ae("beforeRegisterRemote"),registerRemote:new ae("registerRemote"),beforeRequest:new W("beforeRequest"),onLoad:new C("onLoad"),handlePreloadModule:new D("handlePreloadModule"),errorLoadRemote:new C("errorLoadRemote"),beforePreloadRemote:new C("beforePreloadRemote"),generatePreloadAssets:new C("generatePreloadAssets"),afterPreloadRemote:new C,loadEntry:new C}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,r){return(r.remotes||[]).reduce((o,a)=>(this.registerRemote(a,o,{force:!1}),o),e.remotes)}setIdToRemoteMap(e,r){const{remote:n,expose:o}=r,{name:a,alias:s}=n;if(this.idToRemoteMap[e]={name:n.name,expose:o},s&&e.startsWith(a)){const i=e.replace(a,s);this.idToRemoteMap[i]={name:n.name,expose:o};return}if(s&&e.startsWith(s)){const i=e.replace(s,a);this.idToRemoteMap[i]={name:n.name,expose:o}}}async loadRemote(e,r){const{host:n}=this;try{const{loadFactory:o=!0}=r||{loadFactory:!0},{module:a,moduleOptions:s,remoteMatchInfo:i}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:c,remote:l,expose:u,id:d,remoteSnapshot:f}=i,p=await a.get(d,u,r,f),_=await this.hooks.lifecycle.onLoad.emit({id:d,pkgNameOrAlias:c,expose:u,exposeModule:o?p:void 0,exposeModuleFactory:o?void 0:p,remote:l,options:s,moduleInstance:a,origin:n});return this.setIdToRemoteMap(e,i),typeof _=="function"?_:p}catch(o){const{from:a="runtime"}=r||{from:"runtime"},s=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:o,from:a,lifecycle:"onLoad",origin:n});if(!s)throw o;return s}}async preloadRemote(e){const{host:r}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:r.options,origin:r});const n=vn(r.options.remotes,e);await Promise.all(n.map(async o=>{const{remote:a}=o,s=ie(a),{globalSnapshot:i,remoteSnapshot:c}=await r.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:a}),l=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:r,preloadOptions:o,remote:a,remoteInfo:s,globalSnapshot:i,remoteSnapshot:c});l&&je(s,r,l)}))}registerRemotes(e,r){const{host:n}=this;e.forEach(o=>{this.registerRemote(o,n.options.remotes,{force:r?.force})})}async getRemoteModuleAndOptions(e){const{host:r}=this,{id:n}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:r.options,origin:r})}catch(_){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:r.options,origin:r,from:"runtime",error:_,lifecycle:"beforeRequest"}),!o)throw _}const{id:a}=o,s=We(r.options.remotes,a);O(s,R.getShortErrorMsg(R.RUNTIME_004,R.runtimeDescMap,{hostName:r.options.name,requestId:a}));const{remote:i}=s,c=ie(i),l=await r.sharedHandler.hooks.lifecycle.afterResolve.emit({id:a,...s,options:r.options,origin:r,remoteInfo:c}),{remote:u,expose:d}=l;O(u&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let f=r.moduleCache.get(u.name);const p={host:r,remoteInfo:c};return f||(f=new Ke(p),r.moduleCache.set(u.name,f)),{module:f,moduleOptions:p,remoteMatchInfo:l}}registerRemote(e,r,n){const{host:o}=this,a=()=>{if(e.alias){const i=r.find(c=>e.alias&&(c.name.startsWith(e.alias)||c.alias?.startsWith(e.alias)));O(!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&&S.isBrowserEnv()&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=le),e.type||(e.type=xt)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const s=r.find(i=>i.name===e.name);if(!s)a(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const i=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];n?.force&&(this.removeRemote(s),a(),r.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),S.warn(i.join(" ")))}}removeRemote(e){try{const{host:r}=this,{name:n}=e,o=r.options.remotes.findIndex(s=>s.name===n);o!==-1&&r.options.remotes.splice(o,1);const a=r.moduleCache.get(e.name);if(a){const s=a.remoteInfo,i=s.entryGlobalName;N[i]&&(Object.getOwnPropertyDescriptor(N,i)?.configurable?delete N[i]:N[i]=void 0);const c=we(a.remoteInfo);V[c]&&delete V[c],r.snapshotHandler.manifestCache.delete(s.entry);let l=s.buildVersion?S.composeKeyWithSeparator(s.name,s.buildVersion):s.name;const u=N.__FEDERATION__.__INSTANCES__.findIndex(f=>s.buildVersion?f.options.id===l:f.name===l);if(u!==-1){const f=N.__FEDERATION__.__INSTANCES__[u];l=f.options.id||l;const p=Ve();let _=!0;const g=[];Object.keys(p).forEach(h=>{const y=p[h];y&&Object.keys(y).forEach(E=>{const b=y[E];b&&Object.keys(b).forEach($=>{const M=b[$];M&&Object.keys(M).forEach(B=>{const A=M[B];A&&typeof A=="object"&&A.from===s.name&&(A.loaded||A.loading?(A.useIn=A.useIn.filter(H=>H!==s.name),A.useIn.length?_=!1:g.push([h,E,$,B])):g.push([h,E,$,B]))})})})}),_&&(f.shareScopeMap={},delete p[l]),g.forEach(([h,y,E,b])=>{delete p[h]?.[y]?.[E]?.[b]}),N.__FEDERATION__.__INSTANCES__.splice(u,1)}const{hostGlobalSnapshot:d}=Qt(e,r);if(d){const f=d&&"remotesInfo"in d&&d.remotesInfo&&j(d.remotesInfo,e.name).key;f&&(delete d.remotesInfo[f],q.__FEDERATION__.__MANIFEST_LOADING__[f]&&delete q.__FEDERATION__.__MANIFEST_LOADING__[f])}r.moduleCache.delete(e.name)}}catch(r){Te.log("removeRemote fail: ",r)}}}const Wn=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;class jn{constructor(e){this.hooks=new X({beforeInit:new ae("beforeInit"),init:new D,beforeInitContainer:new W("beforeInitContainer"),initContainer:new W("initContainer")}),this.version="0.21.6",this.moduleCache=new Map,this.loaderHook=new X({getModuleInfo:new D,createScript:new D,createLink:new D,fetch:new C,loadEntryError:new C,getModuleFactory:new C}),this.bridgeHook=new X({beforeBridgeRender:new D,afterBridgeRender:new D,beforeBridgeDestroy:new D,afterBridgeDestroy:new D});const r=Wn?[Hn(),xn()]:[],n={id:Nn(),name:e.name,plugins:r,remotes:[],shared:{},inBrowser:S.isBrowserEnv()};this.name=e.name,this.options=n,this.snapshotHandler=new Un(this),this.sharedHandler=new Bn(this),this.remoteHandler=new Vn(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){this.registerPlugins(e.plugins);const r=this.formatOptions(this.options,e);return this.options=r,r}async loadShare(e,r){return this.sharedHandler.loadShare(e,r)}loadShareSync(e,r){return this.sharedHandler.loadShareSync(e,r)}initializeSharing(e=le,r){return this.sharedHandler.initializeSharing(e,r)}initRawContainer(e,r,n){const o=ie({name:e,entry:r}),a=new Ke({host:this,remoteInfo:o});return a.remoteEntryExports=n,this.moduleCache.set(e,a),a}async loadRemote(e,r){return this.remoteHandler.loadRemote(e,r)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,r,n={}){this.sharedHandler.initShareScopeMap(e,r,n)}formatOptions(e,r){const{shared:n}=Kt(e,r),{userOptions:o,options:a}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:r,options:e,shareInfo:n}),s=this.remoteHandler.formatAndRegisterRemote(a,o),{shared:i}=this.sharedHandler.registerShared(a,o),c=[...a.plugins];o.plugins&&o.plugins.forEach(u=>{c.includes(u)||c.push(u)});const l={...e,...r,plugins:c,remotes:s,shared:i};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){const r=Tn(e,this);this.options.plugins=this.options.plugins.reduce((n,o)=>(o&&n&&!n.find(a=>a.name===o.name)&&n.push(o),n),r||[])}registerRemotes(e,r){return this.remoteHandler.registerRemotes(e,r)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}}var Kn=Object.freeze({__proto__:null});I.loadScript=S.loadScript;I.loadScriptNode=S.loadScriptNode;I.CurrentGlobal=N;I.Global=q;I.Module=Ke;I.ModuleFederation=jn;I.addGlobalSnapshot=Ce;I.assert=O;I.getGlobalFederationConstructor=Lt;I.getGlobalSnapshot=Ee;I.getInfoWithoutType=j;I.getRegisteredShare=Y;I.getRemoteEntry=se;I.getRemoteInfo=ie;I.helpers=kn;I.isStaticResourcesEqual=Br;I.matchRemoteWithNameAndExpose=We;I.registerGlobalPlugins=kt;I.resetFederationGlobalInfo=Ot;I.safeWrapper=Gr;I.satisfy=re;I.setGlobalFederationConstructor=Ft;I.setGlobalFederationInstance=vt;I.types=Kn;var er={},qn=I;function zn(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Yn(t,e){const r=zn();return qn.CurrentGlobal.__FEDERATION__.__INSTANCES__.find(n=>!!(r&&n.options.id===r||n.options.name===t&&!n.options.version&&!e||n.options.name===t&&e&&n.options.version===e))}er.getGlobalFederationInstance=Yn;var k=I,Xn=er;function Jn(t){const e=k.getGlobalFederationConstructor()||k.ModuleFederation,r=new e(t);return k.setGlobalFederationInstance(r),r}let fe=null;function Zn(t){const e=Xn.getGlobalFederationInstance(t.name,t.version);return e?(e.initOptions(t),fe||(fe=e),e):(fe=Jn(t),fe)}k.setGlobalFederationConstructor(k.ModuleFederation);k.Module;k.ModuleFederation;k.getRemoteEntry;k.getRemoteInfo;k.loadScript;k.loadScriptNode;k.registerGlobalPlugins;var eo=Zn;const Ae="__mf_init____mf__virtual/adminUI__mf_v__runtimeInit__mf_v__.js__";if(!globalThis[Ae]){let t,e;const r=new Promise((n,o)=>{t=n,e=o});globalThis[Ae]={initPromise:r,initResolve:t,initReject:e}}const{initPromise:to,initResolve:ro,initReject:no}=globalThis[Ae];export{ro as a,to as b,eo as i};
|
|
8
|
-
//# sourceMappingURL=adminUI__mf_v__runtimeInit__mf_v__-OBqvctZP.js.map
|