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